1111
1212var ReactControlledComponent = require ( 'ReactControlledComponent' ) ;
1313
14- // Used as a way to call batchedUpdates when we don't know if we're in a Fiber
15- // or Stack context . Such as when we're dispatching events or if third party
14+ // Used as a way to call batchedUpdates when we don't have a reference to
15+ // the renderer . Such as when we're dispatching events or if third party
1616// libraries need to call batchedUpdates. Eventually, this API will go away when
1717// everything is batched by default. We'll then have a similar API to opt-out of
1818// scheduled work and instead do synchronous work.
1919
2020// Defaults
21- var stackBatchedUpdates = function ( fn , a , b , c , d , e ) {
22- return fn ( a , b , c , d , e ) ;
23- } ;
2421var fiberBatchedUpdates = function ( fn , bookkeeping ) {
2522 return fn ( bookkeeping ) ;
2623} ;
2724
28- function performFiberBatchedUpdates ( fn , bookkeeping ) {
25+ function batchedUpdates ( fn , bookkeeping ) {
2926 // If we have Fiber loaded, we need to wrap this in a batching call so that
3027 // Fiber can apply its default priority for this call.
3128 return fiberBatchedUpdates ( fn , bookkeeping ) ;
3229}
33- function batchedUpdates ( fn , bookkeeping ) {
34- // We first perform work with the stack batching strategy, by passing our
35- // indirection to it.
36- return stackBatchedUpdates ( performFiberBatchedUpdates , fn , bookkeeping ) ;
37- }
3830
3931var isNestingBatched = false ;
4032function batchedUpdatesWithControlledComponents ( fn , bookkeeping ) {
@@ -58,9 +50,6 @@ function batchedUpdatesWithControlledComponents(fn, bookkeeping) {
5850}
5951
6052var ReactGenericBatchingInjection = {
61- injectStackBatchedUpdates : function ( _batchedUpdates ) {
62- stackBatchedUpdates = _batchedUpdates ;
63- } ,
6453 injectFiberBatchedUpdates : function ( _batchedUpdates ) {
6554 fiberBatchedUpdates = _batchedUpdates ;
6655 } ,
0 commit comments