mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-07 22:42:13 +08:00
[ReactNative] Add RCTBridgeDelegate
Summary: Add a new bridge delegate protocol to allow a more flexible bridge configuration. For now it just support the pre-existent configurations + providing the JavaScript source to the bridge, that should allow pre-loading sources.
This commit is contained in:
@@ -15,23 +15,10 @@
|
||||
#import "RCTUtils.h"
|
||||
|
||||
@implementation RCTJavaScriptLoader
|
||||
{
|
||||
__weak RCTBridge *_bridge;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
||||
{
|
||||
RCTAssert(bridge, @"bridge parameter is required");
|
||||
|
||||
if ((self = [super init])) {
|
||||
_bridge = bridge;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
RCT_NOT_IMPLEMENTED(-init)
|
||||
|
||||
- (void)loadBundleAtURL:(NSURL *)scriptURL onComplete:(void (^)(NSError *, NSString *))onComplete
|
||||
+ (void)loadBundleAtURL:(NSURL *)scriptURL onComplete:(RCTSourceLoadBlock)onComplete
|
||||
{
|
||||
// Sanitize the script URL
|
||||
scriptURL = [RCTConvert NSURL:scriptURL.absoluteString];
|
||||
|
||||
Reference in New Issue
Block a user