Added event emitters and fixed document deletion

This commit is contained in:
Jori Lallo
2017-08-03 16:48:07 +03:00
parent 0851cf3fc2
commit ad44c67a46
9 changed files with 65 additions and 12 deletions

View File

@ -0,0 +1,19 @@
// @flow
import { EventEmitter } from 'fbemitter';
import _ from 'lodash';
const emitter = new EventEmitter();
window.__emitter = emitter;
class BaseStore {
emitter: EventEmitter;
on: (eventName: string, callback: Function) => void;
emit: (eventName: string, data: any) => void;
constructor() {
_.extend(this, emitter);
this.on = emitter.addListener;
}
}
export default BaseStore;