UNPKG

570 BJavaScriptView Raw
1class PluginHandler {
2
3 plugins = [];
4
5 constructor() {
6 }
7
8
9 addPlugin(plugin) {
10 this.plugins.push(plugin)
11 }
12
13 getOnReducerEventFun() {
14 return this.plugins.filter(plugin => plugin.onReducer).map(plugin => plugin.onReducer);
15 }
16
17 getOnEffectEventFun() {
18 return this.plugins.filter(plugin => plugin.onEffect).map(plugin => plugin.onEffect);
19 }
20
21 getOnStateChangeEventFun() {
22 return this.plugins.filter(plugin => plugin.onStateChange).map(plugin => plugin.onStateChange)
23 }
24
25}
26
27export default PluginHandler
\No newline at end of file