123456789101112131415161718192021222324252627282930 |
- var Eventual = require('../../lib/eventual');
- var events = new Eventual();
- var ctx = events.createContext();
- ctx.on('hello:from:the',(e) => {
- e.wait();
- console.log("Will be done in a sec");
- setTimeout(() => {
- console.log("Continue");
- e.done();
- },1000);
- });
- ctx.on('hello:from',(e) => {
- console.log("The other side");
- e.stop();
- });
- ctx.on('hello',(e) => {
- console.log("Worked");
- });
- ctx.propagate('hello:from:the:other:side')
- .done(() => {
- console.log("Events called");
- });
|