1.1.10 • Published 4 years ago
goodteditor-event-bus v1.1.10
goodteditor-event-bus
Run your tests
npm run test
EventBus usage
import { EventBus, EventBusEvent, EventBusWrapper } from 'goodteditor-event-bus';
// EventBus usage
let eb = new EventBus();
eb.listen('my-event', (e, data) => console.log(e, data));
eb.trigger('my-event', 'Hello world!');
EventBusWrapper usage
import { EventBus, EventBusEvent, EventBusWrapper } from 'goodteditor-event-bus';
let eb = new EventBus();
let a = new EventBusWrapper(eb);
// setup varAlias to listen 'state change' event
a.varAliases = { myVar: { listen: 'some-uniq-var-name' } };
a.listenStateChange((e, data) => console.log(e, data));
let b = new EventBusWrapper(eb);
// setup varAlias to trigger 'state change' event
b.varAliases = { myCoolVar: { trigger: 'some-uniq-var-name' } };
b.triggerStateChange({ myCoolVar: 'Hello world!' });
1.2.0-alpha.1
4 years ago
1.1.10
4 years ago
1.1.9
5 years ago
1.1.8
5 years ago
1.1.7
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago