Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions React/Base/RCTBridge+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ RCT_EXTERN void RCTRegisterModule(Class);
*/
- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue;

/**
* Call JSIExecutor::flush
*/
- (void)flush;

/**
* Get the module data for a given module name. Used by UIManager to implement
* the `dispatchViewManagerCommand` method.
Expand Down
5 changes: 5 additions & 0 deletions React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,11 @@ - (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue
}
}

- (void)flush
{
_reactInstance->flush();
}

#pragma mark - RCTInvalidating

- (void)invalidate
Expand Down
4 changes: 4 additions & 0 deletions ReactCommon/cxxreact/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ std::shared_ptr<CallInvoker> Instance::getJSCallInvoker() {
return std::static_pointer_cast<CallInvoker>(jsCallInvoker_);
}

void Instance::flush() {
nativeToJsBridge_->runOnExecutorQueue([](JSExecutor *executor) { executor->flush(); });
}

RuntimeExecutor Instance::getRuntimeExecutor() {
std::weak_ptr<NativeToJsBridge> weakNativeToJsBridge = nativeToJsBridge_;

Expand Down
1 change: 1 addition & 0 deletions ReactCommon/cxxreact/Instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class RN_EXPORT Instance {
std::string &&method,
folly::dynamic &&params);
void callJSCallback(uint64_t callbackId, folly::dynamic &&params);
void flush();

// This method is experimental, and may be modified or removed.
void registerBundle(uint32_t bundleId, const std::string &bundlePath);
Expand Down