mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 05:15:49 +08:00
Added support for synchronous methods in native modules on iOS
Reviewed By: javache Differential Revision: D4947556 fbshipit-source-id: 0ef73dc5d741201e59fef1fc048809afc65c75b5
This commit is contained in:
committed by
Facebook Github Bot
parent
2d3a272e0e
commit
db0c22192c
@@ -17,6 +17,17 @@ typedef NS_ENUM(NSUInteger, RCTFunctionType) {
|
||||
RCTFunctionTypeSync,
|
||||
};
|
||||
|
||||
static inline const char *RCTFunctionDescriptorFromType(RCTFunctionType type) {
|
||||
switch (type) {
|
||||
case RCTFunctionTypeNormal:
|
||||
return "async";
|
||||
case RCTFunctionTypePromise:
|
||||
return "promise";
|
||||
case RCTFunctionTypeSync:
|
||||
return "sync";
|
||||
}
|
||||
};
|
||||
|
||||
@protocol RCTBridgeMethod <NSObject>
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *JSMethodName;
|
||||
|
||||
Reference in New Issue
Block a user