Skip to content

Commit

Permalink
Move reason to a constant
Browse files Browse the repository at this point in the history
Summary: Moves the reason to a constant because APPARENTLY this is a best practice in this establishment

Reviewed By: sammy-SC

Differential Revision: D17627819

fbshipit-source-id: 328fad8b7482d0e379a41b5f8c841f71db2bb5ac
  • Loading branch information
rickhanlonii authored and facebook-github-bot committed Sep 30, 2019
1 parent 7e49a63 commit d0324f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions React/Base/RCTBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ RCT_EXTERN NSString *const RCTBridgeDidInvalidateModulesNotification;
*/
RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationSourceKey;


/**
* Key for the reload reason in the RCTBridgeWillReloadNotification userInfo dictionary.
*/
RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationReasonKey;

/**
* Key for the bridge description (NSString_ in the
* RCTBridgeDidDownloadScriptNotification userInfo dictionary.
Expand Down
3 changes: 2 additions & 1 deletion React/Base/RCTBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
NSString *const RCTBridgeWillInvalidateModulesNotification = @"RCTBridgeWillInvalidateModulesNotification";
NSString *const RCTBridgeDidInvalidateModulesNotification = @"RCTBridgeDidInvalidateModulesNotification";
NSString *const RCTBridgeDidDownloadScriptNotificationSourceKey = @"source";
NSString *const RCTBridgeDidDownloadScriptNotificationReasonKey = @"reason";
NSString *const RCTBridgeDidDownloadScriptNotificationBridgeDescriptionKey = @"bridgeDescription";

static NSMutableArray<Class> *RCTModuleClasses;
Expand Down Expand Up @@ -306,7 +307,7 @@ - (void)reloadWithReason:(NSString *)reason
[RCTInspectorDevServerHelper disableDebugger];
#endif

[[NSNotificationCenter defaultCenter] postNotificationName:RCTBridgeWillReloadNotification object:self userInfo:@{@"reason": reason} ];
[[NSNotificationCenter defaultCenter] postNotificationName:RCTBridgeWillReloadNotification object:self userInfo:@{RCTBridgeDidDownloadScriptNotificationReasonKey: reason} ];

/**
* Any thread
Expand Down

0 comments on commit d0324f6

Please sign in to comment.