From c7de1f90e2e3e195cfed7266d8c53702ceedc1c0 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 21 Jul 2021 18:08:45 +0800 Subject: [PATCH] refact:compat DoricJSLoaderManager api --- .../main/java/pub/doric/loader/DoricJSLoaderManager.java | 5 +++++ doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.h | 2 ++ doric-iOS/Pod/Classes/Loader/DoricJSLoaderManager.m | 6 ++++++ 3 files changed, 13 insertions(+) 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:@[