CMD+R should post a refresh notification.

Summary:
For the sake of consistency, `cmd+r` should just post a refresh notification. This way other tools can also observe and react to the refresh without ugly hacks.
Closes https://github.com/facebook/react-native/pull/2175
Github Author: Tj <tfallon@mail.depaul.edu>
This commit is contained in:
Tj 2015-08-07 04:36:10 -07:00
parent 9edad17a15
commit c933087567
1 changed files with 5 additions and 3 deletions

View File

@ -199,14 +199,16 @@ RCT_NOT_IMPLEMENTED(-init)
#if TARGET_IPHONE_SIMULATOR
__weak RCTBridge *weakSelf = self;
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
// reload in current mode
[commands registerKeyCommandWithInput:@"r"
modifierFlags:UIKeyModifierCommand
action:^(__unused UIKeyCommand *command) {
[weakSelf reload];
action:^(__unused UIKeyCommand *command)
{
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification
object:nil
userInfo:nil];
}];
#endif