Move setDefaults call to constructor.

Reviewed By: javache

Differential Revision: D3514703

fbshipit-source-id: 8195778b23868eae36a55edc2d5d4f148b36a12e
This commit is contained in:
Nathan Azaria 2016-07-04 10:45:38 -07:00 коммит произвёл Facebook Github Bot 4
Родитель 85983d0ae4
Коммит a9a0ff267f
2 изменённых файлов: 14 добавлений и 11 удалений

Просмотреть файл

@ -32,18 +32,22 @@ static NSString *ipGuess;
}
#endif
- (instancetype)init
{
self = [super init];
if (self) {
[self setDefaults];
}
return self;
}
- (NSDictionary *)defaults
{
static NSDictionary *defaults;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
defaults = @{
kRCTEnableLiveReloadKey: @NO,
kRCTEnableDevKey: @YES,
kRCTEnableMinificationKey: @NO,
};
});
return defaults;
return @{
kRCTEnableLiveReloadKey: @NO,
kRCTEnableDevKey: @YES,
kRCTEnableMinificationKey: @NO,
};
}
- (void)settingsUpdated

Просмотреть файл

@ -18,7 +18,6 @@
{
NSURL *jsCodeLocation;
[[RCTBundleURLProvider sharedSettings] setDefaults];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation