mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
9 lines
295 B
TypeScript
9 lines
295 B
TypeScript
import NanoEvents = require('nanoevents');
|
|
import unbindAll = require('nanoevents/unbind-all');
|
|
|
|
const emitter = new NanoEvents<{foo: {foo: string}, bar: {bar: string}}>();
|
|
const unbind = emitter.on('foo', action => action.foo);
|
|
emitter.emit('bar', {bar: 'test'});
|
|
unbind();
|
|
unbindAll(emitter);
|