1.1.10 • Published 3 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
3 years ago
1.1.10
3 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.10
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago