File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 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 '
22
33// encapsulates the subscription logic for connecting a component to the redux store, as
44// well as nesting subscriptions of descendant components, so that we can ensure the
@@ -7,7 +7,7 @@ import { unstable_batchedUpdates } from 'react-dom'
77const CLEARED = null
88const nullListeners = { notify ( ) { } }
99
10- function createListenerCollection ( ) {
10+ function createListenerCollection ( batch ) {
1111 // the current/next pattern is copied from redux's createStore code.
1212 // TODO: refactor+expose that code to be reusable here?
1313 let current = [ ]
@@ -21,7 +21,7 @@ function createListenerCollection() {
2121
2222 notify ( ) {
2323 const listeners = ( current = next )
24- unstable_batchedUpdates ( ( ) => {
24+ batch ( ( ) => {
2525 for ( let i = 0 ; i < listeners . length ; i ++ ) {
2626 listeners [ i ] ( )
2727 }
@@ -83,7 +83,7 @@ export default class Subscription {
8383 ? this . parentSub . addNestedSub ( this . handleChangeWrapper )
8484 : this . store . subscribe ( this . handleChangeWrapper )
8585
86- this . listeners = createListenerCollection ( )
86+ this . listeners = createListenerCollection ( getBatch ( ) )
8787 }
8888 }
8989
You can’t perform that action at this time.
0 commit comments