1 | #import "Restart.h"
|
2 |
|
3 | @implementation Restart
|
4 |
|
5 | RCT_EXPORT_MODULE(RNRestart)
|
6 |
|
7 | - (void)loadBundle
|
8 | {
|
9 | RCTTriggerReloadCommandListeners(@"react-native-restart: Restart");
|
10 | }
|
11 |
|
12 | RCT_EXPORT_METHOD(Restart) {
|
13 | if ([NSThread isMainThread]) {
|
14 | [self loadBundle];
|
15 | } else {
|
16 | dispatch_sync(dispatch_get_main_queue(), ^{
|
17 | [self loadBundle];
|
18 | });
|
19 | }
|
20 | return;
|
21 | }
|
22 |
|
23 | @end
|