File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- import { unstable_batchedUpdates } from 'react-dom '
1
+ import { getBatch } from './batch '
2
2
3
3
// encapsulates the subscription logic for connecting a component to the redux store, as
4
4
// well as nesting subscriptions of descendant components, so that we can ensure the
@@ -7,7 +7,7 @@ import { unstable_batchedUpdates } from 'react-dom'
7
7
const CLEARED = null
8
8
const nullListeners = { notify ( ) { } }
9
9
10
- function createListenerCollection ( ) {
10
+ function createListenerCollection ( batch ) {
11
11
// the current/next pattern is copied from redux's createStore code.
12
12
// TODO: refactor+expose that code to be reusable here?
13
13
let current = [ ]
@@ -21,7 +21,7 @@ function createListenerCollection() {
21
21
22
22
notify ( ) {
23
23
const listeners = ( current = next )
24
- unstable_batchedUpdates ( ( ) => {
24
+ batch ( ( ) => {
25
25
for ( let i = 0 ; i < listeners . length ; i ++ ) {
26
26
listeners [ i ] ( )
27
27
}
@@ -83,7 +83,7 @@ export default class Subscription {
83
83
? this . parentSub . addNestedSub ( this . handleChangeWrapper )
84
84
: this . store . subscribe ( this . handleChangeWrapper )
85
85
86
- this . listeners = createListenerCollection ( )
86
+ this . listeners = createListenerCollection ( getBatch ( ) )
87
87
}
88
88
}
89
89
You can’t perform that action at this time.
0 commit comments