Skip to content

Commit d8bdd63

Browse files
committed
CR feedback
1 parent 4fe0f87 commit d8bdd63

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CodePush.js

+1
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ function codePushify(options = {}) {
446446
}
447447

448448
if (typeof options === "function") {
449+
// Infer that the root component was directly passed to us.
449450
return decorator(options);
450451
} else {
451452
return decorator;

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -718,11 +718,11 @@ When you require `react-native-code-push`, the module object provides the follow
718718
#### codePush
719719
720720
```javascript
721-
// Wrapper functions
721+
// Wrapper function
722722
codePush(rootComponent: React.Component): React.Component;
723723
codePush(options: CodePushOptions)(rootComponent: React.Component): React.Component;
724724

725-
// Decorators; Requires ES7 support
725+
// Decorator; Requires ES7 support
726726
@codePush
727727
@codePush(options: CodePushOptions)
728728
```
@@ -738,15 +738,15 @@ This decorator provides support for letting you customize its behaviour to easil
738738
// sync with the server, without ever
739739
// interrupting the end user
740740
class MyApp extends Component {}
741-
codePush(MyApp);
741+
MyApp = codePush(MyApp);
742742
```
743743
744744
2. **Silent sync everytime the app resumes**. Same as 1, except we check for updates, or apply an update if one exists every time the app returns to the foreground after being "backgrounded".
745745
746746
```javascript
747747
// Sync for updates everytime the app resumes.
748748
class MyApp extends Component {}
749-
codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })(MyApp);
749+
MyApp = codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })(MyApp);
750750
```
751751
752752
3. **Interactive**. When an update is available, prompt the end user for permission before downloading it, and then immediately apply the update. If an update was released using the `mandatory` flag, the end user would still be notified about the update, but they wouldn't have the choice to ignore it.
@@ -756,7 +756,7 @@ This decorator provides support for letting you customize its behaviour to easil
756756
// about each update, and displays it to them
757757
// immediately after downloading it
758758
class MyApp extends Component {}
759-
codePush({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE })(MyApp);
759+
MyApp = codePush({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE })(MyApp);
760760
```
761761
762762
4. **Log/display progress**. While the app is syncing with the server for updates, make use of the `codePushStatusDidChange` and/or `codePushDownloadDidProgress` event hooks to log down the different stages of this process, or even display a progress bar to the user.
@@ -789,7 +789,7 @@ This decorator provides support for letting you customize its behaviour to easil
789789
console.log(progess.receivedBytes + " of " + progress.totalBytes + " received.");
790790
}
791791
}
792-
codePush(MyApp);
792+
MyApp = codePush(MyApp);
793793
```
794794
795795
##### CodePushOptions

0 commit comments

Comments
 (0)