mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 09:12:06 +08:00
Add context executor API for sync hooks
Summary: public This exposes a proper API for adding synchronous callbacks to JS, as an optional feature of the executor. This is based on nicklockwood's work in D2764492, but avoids refactoring bridge/executor interactions for the time being, since we agree on this API and can move the actual callsites around later. Reviewed By: nicklockwood Differential Revision: D2799506 fb-gh-sync-id: af209d9a0be927f3404205feb16e59745cc37aec
This commit is contained in:
committed by
facebook-github-bot-7
parent
1c1d7006c2
commit
a5d82c2823
@@ -85,4 +85,10 @@ typedef void (^RCTJavaScriptCallback)(id json, NSError *error);
|
||||
*/
|
||||
- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block;
|
||||
|
||||
/**
|
||||
* For executors that support it, this method can be used to add a synchronous
|
||||
* callback function for communicating with the javascript context.
|
||||
*/
|
||||
- (void)addSynchronousHookWithName:(NSString *)name usingBlock:(id)block;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user