diff --git a/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java b/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java index 052871c3..ef3c7504 100644 --- a/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java +++ b/doric-android/doric/src/main/java/pub/doric/loader/DoricJSLoaderManager.java @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; +import pub.doric.DoricSingleton; import pub.doric.async.AsyncResult; /** @@ -68,4 +69,8 @@ public class DoricJSLoaderManager { return ret; } + + public static DoricJSLoaderManager getInstance() { + return DoricSingleton.getInstance().getJsLoaderManager(); + } } diff --git a/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.h b/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.h index 198b73fb..575acb94 100644 --- a/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.h +++ b/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.h @@ -25,6 +25,8 @@ #import "DoricAsyncResult.h" @interface DoricJSLoaderManager : NSObject ++ (instancetype)instance; + - (void)addJSLoader:(id )loader; - (DoricAsyncResult *)request:(NSString *)source; diff --git a/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.m b/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.m index 8e0a6df9..a76c45a2 100644 --- a/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.m +++ b/doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.m @@ -24,12 +24,18 @@ #import "DoricMainBundleJSLoader.h" #import "DoricHttpJSLoader.h" #import "Doric.h" +#import "DoricSingleton.h" @interface DoricJSLoaderManager () @property(nonatomic, copy) NSSet > *loaders; @end @implementation DoricJSLoaderManager + ++ (instancetype)instance { + return DoricSingleton.instance.jsLoaderManager; +} + - (instancetype)init { if (self = [super init]) { _loaders = [[NSSet alloc] initWithArray:@[