react-native-macos/Libraries/Utilities
James Ide 2a6fe079c0 [Timers] Batch setImmediate handlers
Summary:
Wraps the setImmediate handlers in a `batchUpdates` call before they are synchronously executed at the end of the JS execution loop.

Closes https://github.com/facebook/react-native/pull/1242
Github Author: James Ide <ide@jameside.com>

Test Plan:
 Added two `setImmediate` calls to `componentDidMount` in UIExplorerApp. Each handler calls `setState`, and `componentWillUpdate` logs its state. With this diff, we can see the state updates are successfully batched.

```javascript
componentDidMount() {
  setImmediate(() => {
    console.log('immediate 1');
    this.setState({a: 1});
  });
  setImmediate(() => {
    console.log('immediate 2');
    this.setState({a: 2});
  });
},

componentWillUpdate(nextProps, nextState) {
  console.log('componentWillUpdate with next state.a =', nextState.a);
},
```

**Before:**

"immediate 1"
"componentWillUpdate with next state.a =", 1
"immediate 2"
"componentWillUpdate with next state.a =", 2

**After:**

"immediate 1"
"immediate 2"
"componentWillUpdate with next state.a =", 2

Addresses the batching issue in #1232. cc @vjeux @spicyj
2015-06-01 16:23:12 -08:00
..
__mocks__ [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
__tests__ [ReactNative] decompose transform matrix 2015-05-13 13:24:37 -07:00
differ [ReactNative] Fix warnings w/h => width/height 2015-05-02 10:22:59 -08:00
AlertIOS.js [ReactNative] Add prompt to AlertIOS 2015-05-13 13:24:36 -07:00
BackAndroid.ios.js [ReactNative] Replace Backstack with BackAndroid 2015-04-07 16:07:42 -08:00
CSSVarConfig.js [ReactNative] OSS JSNavigationStack w/ Examples 2015-03-24 09:39:40 -08:00
Dimensions.js Expose fontScale to JS 2015-06-01 10:25:38 -08:00
ErrorUtils.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
MatrixMath.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
MessageQueue.js [Timers] Batch setImmediate handlers 2015-06-01 16:23:12 -08:00
PixelRatio.js Expose fontScale to JS 2015-06-01 10:25:38 -08:00
Platform.ios.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
RCTLog.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
RCTRenderingPerf.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
buildStyleInterpolator.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
createStrictShapeTypeChecker.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
cssVar.js [ReactNative] OSS JSNavigationStack w/ Examples 2015-03-24 09:39:40 -08:00
deepFreezeAndThrowOnMutationInDev.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
groupByEveryN.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
logError.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
mergeFast.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
mergeIntoFast.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
nativeModulePrefixNormalizer.js Flowify Library/Utilities/ 2015-03-23 16:47:26 -08:00
stringifySafe.js [ReactNative] improve console logging a little bit 2015-05-04 18:57:03 -08:00
truncate.js [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00