Skip to content

Commit

Permalink
Make executeAsyncBlockOnJavaScriptQueue required
Browse files Browse the repository at this point in the history
Summary: This leaves no optional methods on `RCTJavaScriptExecutor`, which is certainly a good thing.

Reviewed By: majak

Differential Revision: D3518915

fbshipit-source-id: e606b9076c3299f81a225a181ea244148a1832cb
  • Loading branch information
adamjernst authored and seraj-ahmad committed Oct 26, 2016
1 parent 9636ce8 commit e394cdc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 2 additions & 9 deletions React/Base/RCTBatchedBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -747,18 +747,11 @@ - (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args
- (void)_immediatelyCallTimer:(NSNumber *)timer
{
RCTAssertJSThread();

dispatch_block_t block = ^{
[_javaScriptExecutor executeAsyncBlockOnJavaScriptQueue:^{
[self _actuallyInvokeAndProcessModule:@"JSTimersExecution"
method:@"callTimers"
arguments:@[@[timer]]];
};

if ([_javaScriptExecutor respondsToSelector:@selector(executeAsyncBlockOnJavaScriptQueue:)]) {
[_javaScriptExecutor executeAsyncBlockOnJavaScriptQueue:block];
} else {
[_javaScriptExecutor executeBlockOnJavaScriptQueue:block];
}
}];
}

- (void)enqueueApplicationScript:(NSData *)script
Expand Down
2 changes: 0 additions & 2 deletions React/Base/RCTJavaScriptExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ typedef void (^RCTJavaScriptCallback)(id json, NSError *error);
*/
- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block;

@optional

/**
* Special case for Timers + ContextExecutor - instead of the default
* if jsthread then call else dispatch call on jsthread
Expand Down

0 comments on commit e394cdc

Please sign in to comment.