mirror of
https://github.com/zoriya/flood.git
synced 2025-12-19 21:55:15 +00:00
24 lines
436 B
JavaScript
24 lines
436 B
JavaScript
import {EventEmitter} from 'events';
|
|
|
|
export default class BaseStore extends EventEmitter {
|
|
constructor() {
|
|
super();
|
|
|
|
this.dispatcherID = null;
|
|
this.on('uncaughtException', this.handleError);
|
|
this.setMaxListeners(20);
|
|
}
|
|
|
|
handleError(error) {
|
|
console.trace(error);
|
|
}
|
|
|
|
listen(event, callback) {
|
|
this.on(event, callback);
|
|
}
|
|
|
|
unlisten(event, callback) {
|
|
this.removeListener(event, callback);
|
|
}
|
|
}
|