refact:compat DoricJSLoaderManager api
This commit is contained in:
parent
844908bdc6
commit
c7de1f90e2
@ -23,6 +23,7 @@ import java.util.Collection;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import pub.doric.DoricSingleton;
|
||||||
import pub.doric.async.AsyncResult;
|
import pub.doric.async.AsyncResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,4 +69,8 @@ public class DoricJSLoaderManager {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static DoricJSLoaderManager getInstance() {
|
||||||
|
return DoricSingleton.getInstance().getJsLoaderManager();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#import "DoricAsyncResult.h"
|
#import "DoricAsyncResult.h"
|
||||||
|
|
||||||
@interface DoricJSLoaderManager : NSObject
|
@interface DoricJSLoaderManager : NSObject
|
||||||
|
+ (instancetype)instance;
|
||||||
|
|
||||||
- (void)addJSLoader:(id <DoricLoaderProtocol>)loader;
|
- (void)addJSLoader:(id <DoricLoaderProtocol>)loader;
|
||||||
|
|
||||||
- (DoricAsyncResult <NSString *> *)request:(NSString *)source;
|
- (DoricAsyncResult <NSString *> *)request:(NSString *)source;
|
||||||
|
@ -24,12 +24,18 @@
|
|||||||
#import "DoricMainBundleJSLoader.h"
|
#import "DoricMainBundleJSLoader.h"
|
||||||
#import "DoricHttpJSLoader.h"
|
#import "DoricHttpJSLoader.h"
|
||||||
#import "Doric.h"
|
#import "Doric.h"
|
||||||
|
#import "DoricSingleton.h"
|
||||||
|
|
||||||
@interface DoricJSLoaderManager ()
|
@interface DoricJSLoaderManager ()
|
||||||
@property(nonatomic, copy) NSSet <id <DoricLoaderProtocol>> *loaders;
|
@property(nonatomic, copy) NSSet <id <DoricLoaderProtocol>> *loaders;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation DoricJSLoaderManager
|
@implementation DoricJSLoaderManager
|
||||||
|
|
||||||
|
+ (instancetype)instance {
|
||||||
|
return DoricSingleton.instance.jsLoaderManager;
|
||||||
|
}
|
||||||
|
|
||||||
- (instancetype)init {
|
- (instancetype)init {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_loaders = [[NSSet alloc] initWithArray:@[
|
_loaders = [[NSSet alloc] initWithArray:@[
|
||||||
|
Reference in New Issue
Block a user