Introduce experimental API to allow overriding how packager run status is determined

Summary: The docs for this new method explain what it does.

Differential Revision: D3556890

fbshipit-source-id: b075e750cdd1e7354e0a26c03b3fd74cca52aeb7
This commit is contained in:
Adam Ernst
2016-07-13 16:39:22 -07:00
committed by Facebook Github Bot 2
parent 16d29fe16f
commit 22eabe59a2
2 changed files with 23 additions and 0 deletions

View File

@@ -45,4 +45,15 @@ extern NSString *const RCTBundleURLProviderUpdatedNotification;
@property (nonatomic, assign) BOOL enableDev;
+ (instancetype)sharedSettings;
/**
* @experimental
* The default behavior of RCTBundleURLProvider (including the singleton shared instance) is to call
* [NSURLConnection +sendSynchronousRequest:returningResponse:error:] to determine if the packager is running at
* startup time. (Note this behavior is only enabled if RCT_DEV is on.) This experimental API allows you to specify
* a custom predicate function that must return YES if the packager is running at the given host and port, and NO
* otherwise.
*/
- (instancetype)initWithPackagerRunningPredicate:(BOOL (*)(NSString *host, NSUInteger port))packagerRunningPredicate;
@end