diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/store/index.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/store/index.js b/src/store/index.js index a0a7791..2d08296 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2,8 +2,12 @@ class Store { constructor(reducer, catcher) { this.reducer = reducer; this.catcher = catcher; - this.state = this.reducer(undefined, {}); this.subscribers = []; + try { + this.state = this.reducer(undefined, {}); + } catch (e) { + catcher(e); + } } dispatch(action, sender) { @@ -20,6 +24,7 @@ class Store { this.catcher(e, sender); } } + return action } getState() { |