refact: use DoricSingleton to hold all static or singleton objects
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
#import "DoricAsyncResult.h"
|
||||
|
||||
@interface DoricJSLoaderManager : NSObject
|
||||
+ (instancetype)instance;
|
||||
|
||||
- (void)addJSLoader:(id <DoricLoaderProtocol>)loader;
|
||||
|
||||
- (DoricAsyncResult <NSString *> *)request:(NSString *)source;
|
||||
|
@@ -30,15 +30,6 @@ @interface DoricJSLoaderManager ()
|
||||
@end
|
||||
|
||||
@implementation DoricJSLoaderManager
|
||||
+ (instancetype)instance {
|
||||
static DoricJSLoaderManager *_instance;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
_instance = [DoricJSLoaderManager new];
|
||||
});
|
||||
return _instance;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
_loaders = [[NSSet alloc] initWithArray:@[
|
||||
|
Reference in New Issue
Block a user