d7c8b4478b
Summary: In accordance with the unwritten rule that any API that takes a callback should also return a promise, I've changed `InteractionManager.runAfterInteractions()` to do just that. ```js InteractionManager.runAfterInteractions(() => { ... }); ``` can become ```js InteractionManager.runAfterInteractions().then(() => { ... }); ``` (but doesn't have to). Most importantly, though, this change enables code like ```js doSomeUIStuff(); await InteractionManager.runAfterInteractions(); doSomeNonUIStuff(); ``` which is nice. Note: Because returning a `Promise` means the callback argument is now optional, the behaviour of the API is slightly changed, though not in a backwards-incompatible way (unless a consumer is in some way relying on the exception, but that would be insane). Closes https://github.com/facebook/react-native/pull/3788 Reviewed By: vjeux Differential Revision: D2634693 Pulled By: josephsavona fb-gh-sync-id: 7315120963be23cf69d777e940b2750d32ae47a8 |
||
---|---|---|
.. | ||
InteractionManager.js | ||
InteractionMixin.js |