mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
add notifications for dev reload
Reviewed By: alexeylang Differential Revision: D5630472 fbshipit-source-id: 1c44a52fddead361b43551384bbfc73e2d89438f
This commit is contained in:
committed by
Facebook Github Bot
parent
36f2d18b10
commit
1ce7e4c1e5
@@ -44,6 +44,24 @@ RCT_EXTERN NSString *const RCTJavaScriptDidFailToLoadNotification;
|
||||
*/
|
||||
RCT_EXTERN NSString *const RCTDidInitializeModuleNotification;
|
||||
|
||||
/**
|
||||
* This notification fires just before the bridge starts processing a request to
|
||||
* reload.
|
||||
*/
|
||||
RCT_EXTERN NSString *const RCTBridgeWillReloadNotification;
|
||||
|
||||
/**
|
||||
* This notification fires just before the bridge begins downloading a script
|
||||
* from the packager.
|
||||
*/
|
||||
RCT_EXTERN NSString *const RCTBridgeWillDownloadScriptNotification;
|
||||
|
||||
/**
|
||||
* This notification fires just after the bridge finishes downloading a script
|
||||
* from the packager.
|
||||
*/
|
||||
RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotification;
|
||||
|
||||
/**
|
||||
* This block can be used to instantiate modules that require additional
|
||||
* init parameters, or additional configuration prior to being used.
|
||||
|
||||
@@ -29,6 +29,9 @@ NSString *const RCTJavaScriptWillStartLoadingNotification = @"RCTJavaScriptWillS
|
||||
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";
|
||||
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
|
||||
NSString *const RCTDidInitializeModuleNotification = @"RCTDidInitializeModuleNotification";
|
||||
NSString *const RCTBridgeWillReloadNotification = @"RCTBridgeWillReloadNotification";
|
||||
NSString *const RCTBridgeWillDownloadScriptNotification = @"RCTBridgeWillDownloadScriptNotification";
|
||||
NSString *const RCTBridgeDidDownloadScriptNotification = @"RCTBridgeDidDownloadScriptNotification";
|
||||
|
||||
static NSMutableArray<Class> *RCTModuleClasses;
|
||||
NSArray<Class> *RCTGetModuleClasses(void)
|
||||
@@ -260,6 +263,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
[RCTInspectorDevServerHelper disableDebugger];
|
||||
#endif
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTBridgeWillReloadNotification object:self];
|
||||
|
||||
/**
|
||||
* Any thread
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user