mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
C++ Turbo Module > Allow Promise<void> types (#52388)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52388 Changelog: [Internal] Similar to `AsyncCallback<>` (the foundation of `AsyncPromise`) we should allow `void` Promise types in C++ such as `AsyncPromise<>` Reviewed By: rbergerjr Differential Revision: D77712020 fbshipit-source-id: d7360df5cc1b77f1e03e5fb73b0b468f6e3a415b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
255977a7b9
commit
e8709355dc
@@ -193,6 +193,8 @@ class NativeCxxModuleExample
|
||||
|
||||
void voidFunc(jsi::Runtime& rt);
|
||||
|
||||
AsyncPromise<> voidPromise(jsi::Runtime& rt);
|
||||
|
||||
void setMenu(jsi::Runtime& rt, MenuItem menuItem);
|
||||
|
||||
void emitCustomDeviceEvent(jsi::Runtime& rt, const std::string& eventName);
|
||||
@@ -201,13 +203,13 @@ class NativeCxxModuleExample
|
||||
|
||||
ObjectStruct getObjectThrows(jsi::Runtime& rt, ObjectStruct arg);
|
||||
|
||||
AsyncPromise<jsi::Value> promiseThrows(jsi::Runtime& rt);
|
||||
AsyncPromise<> promiseThrows(jsi::Runtime& rt);
|
||||
|
||||
void voidFuncAssert(jsi::Runtime& rt);
|
||||
|
||||
ObjectStruct getObjectAssert(jsi::Runtime& rt, ObjectStruct arg);
|
||||
|
||||
AsyncPromise<jsi::Value> promiseAssert(jsi::Runtime& rt);
|
||||
AsyncPromise<> promiseAssert(jsi::Runtime& rt);
|
||||
|
||||
private:
|
||||
std::optional<AsyncCallback<std::string>> valueCallback_;
|
||||
|
||||
Reference in New Issue
Block a user