react-native/Libraries/BatchedBridge
rh389 0a55e42ef6 Refactor MessageQueue
Summary:
Looking to address a few new `FlowFixMe`s I had to do some minor refactoring of `MessageQueue`. Has the advantage of (IMO) making things clearer by removing a redundant counter and some gratuitous bitwise operations.

Previously `_callbacks` was an array of `?Function`s where even elements were failure callbacks and odd elements were successes. Each new call incremented `_callID` by one and `_callbackID` by two. I've changed this to use two arrays `_successCallbacks` and `_failureCallbacks` indexed by `callID`. That made the `_callbackID` counter unnecessary and reduced the need for computed indices.

Tested with flow and a quick play with UIExplorer.
Closes https://github.com/facebook/react-native/pull/11986

Differential Revision: D4962162

Pulled By: javache

fbshipit-source-id: 17dddfedc0cb5950dbdd9bd06fae6eb6de4c4a7d
2017-04-28 04:04:14 -07:00
..
__mocks__ Ignore mocks in packager 2017-02-24 13:01:34 -08:00
__tests__ Replace jest.resetModuleRegistry() with jest.resetModules() 2016-12-18 17:13:38 -08:00
BatchedBridge.js Move BatchedBridge module configuration to InitializeCore 2017-02-22 15:01:11 -08:00
MessageQueue.js Refactor MessageQueue 2017-04-28 04:04:14 -07:00
NativeModules.js Fix crash when overriding native modules on RCTJSCExecutor 2017-03-24 09:31:04 -07:00