We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c646c8 commit bdfeeccCopy full SHA for bdfeecc
tests/reactor-tests.js
@@ -1077,5 +1077,25 @@ describe('Reactor', () => {
1077
}).not.toThrow(
1078
new Error('Dispatch may not be called while a dispatch is in progress'))
1079
})
1080
+
1081
+ it('should allow subsequent dispatches if an error is raised in an observer', () => {
1082
+ var unWatchFn = reactor.observe([], state => {
1083
+ throw new Error('observe error')
1084
+ })
1085
1086
+ expect(() => {
1087
+ reactor.batch(() => {
1088
+ reactor.dispatch('add', 'one')
1089
+ reactor.dispatch('add', 'two')
1090
1091
+ }).toThrow(
1092
+ new Error('observe error'))
1093
1094
+ unWatchFn()
1095
1096
1097
+ reactor.dispatch('add', 'three')
1098
+ }).not.toThrow()
1099
1100
1101
0 commit comments