Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit d6cf63e

Browse files
author
Max
authored
Improve README of integration of CodePush (#1151)
* Update version numbers for new release * improve readme * reverted version
1 parent 79247a5 commit d6cf63e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/api-js.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,18 @@ This decorator provides support for letting you customize its behaviour to easil
5151
// Fully silent update which keeps the app in
5252
// sync with the server, without ever
5353
// interrupting the end user
54-
class MyApp extends Component {}
54+
class MyApp extends Component<{}> {}
5555
MyApp = codePush(MyApp);
56+
export default MyApp;
5657
```
5758

5859
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".
5960

6061
```javascript
6162
// Sync for updates everytime the app resumes.
62-
class MyApp extends Component {}
63+
class MyApp extends Component<{}> {}
6364
MyApp = codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })(MyApp);
65+
export default MyApp;
6466
```
6567

6668
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.
@@ -69,16 +71,17 @@ This decorator provides support for letting you customize its behaviour to easil
6971
// Active update, which lets the end user know
7072
// about each update, and displays it to them
7173
// immediately after downloading it
72-
class MyApp extends Component {}
74+
class MyApp extends Component<{}> {}
7375
MyApp = codePush({ updateDialog: true, installMode: codePush.InstallMode.IMMEDIATE })(MyApp);
76+
export default MyApp;
7477
```
7578
7679
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.
7780
7881
```javascript
7982
// Make use of the event hooks to keep track of
8083
// the different stages of the sync process.
81-
class MyApp extends Component {
84+
class MyApp extends Component<{}> {
8285
codePushStatusDidChange(status) {
8386
switch(status) {
8487
case codePush.SyncStatus.CHECKING_FOR_UPDATE:
@@ -104,6 +107,7 @@ This decorator provides support for letting you customize its behaviour to easil
104107
}
105108
}
106109
MyApp = codePush(MyApp);
110+
export default MyApp;
107111
```
108112
109113
##### CodePushOptions

0 commit comments

Comments
 (0)