Skip to content

Commit a9a0ff2

Browse files
nathanajahFacebook Github Bot 4
authored andcommitted
Move setDefaults call to constructor.
Reviewed By: javache Differential Revision: D3514703 fbshipit-source-id: 8195778b23868eae36a55edc2d5d4f148b36a12e
1 parent 85983d0 commit a9a0ff2

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

React/Base/RCTBundleURLProvider.m

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,22 @@ + (void)initialize
3232
}
3333
#endif
3434

35+
- (instancetype)init
36+
{
37+
self = [super init];
38+
if (self) {
39+
[self setDefaults];
40+
}
41+
return self;
42+
}
43+
3544
- (NSDictionary *)defaults
3645
{
37-
static NSDictionary *defaults;
38-
static dispatch_once_t onceToken;
39-
dispatch_once(&onceToken, ^{
40-
defaults = @{
41-
kRCTEnableLiveReloadKey: @NO,
42-
kRCTEnableDevKey: @YES,
43-
kRCTEnableMinificationKey: @NO,
44-
};
45-
});
46-
return defaults;
46+
return @{
47+
kRCTEnableLiveReloadKey: @NO,
48+
kRCTEnableDevKey: @YES,
49+
kRCTEnableMinificationKey: @NO,
50+
};
4751
}
4852

4953
- (void)settingsUpdated

local-cli/generator-ios/templates/app/AppDelegate.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1818
{
1919
NSURL *jsCodeLocation;
2020

21-
[[RCTBundleURLProvider sharedSettings] setDefaults];
2221
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
2322

2423
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation

0 commit comments

Comments
 (0)