Browse Source

added 'connected' event

master
mortie 8 years ago
parent
commit
65661bc8ee
3 changed files with 7 additions and 1 deletions
  1. 5
    0
      README.md
  2. 1
    0
      client.js
  3. 1
    1
      package.json

+ 5
- 0
README.md View File

events.on("someevent", function(evt) { events.on("someevent", function(evt) {
// evt -> { some: "parameters" } // evt -> { some: "parameters" }
}); });

// Do something whenever the client connects (or reconnects)
events.on("connection", function() {
// Connected!
});
``` ```

+ 1
- 0
client.js View File

return; return;
} }


self.emit("connection");
key = res.key; key = res.key;
await(); await();
}); });

+ 1
- 1
package.json View File

{ {
"name": "webevents", "name": "webevents",
"version": "1.0.2",
"version": "1.1.0",
"description": "A simple library for sending events from the server to the client.", "description": "A simple library for sending events from the server to the client.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

Loading…
Cancel
Save