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 committed by Facebook Github Bot 4
parent 85983d0ae4
commit a9a0ff267f
2 changed files with 14 additions and 11 deletions

View File

@ -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

View File

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