Skip to content

Commit 890dbe8

Browse files
committed
chore(Runtime): add guide for updateChecker usage
1 parent 68c8da8 commit 890dbe8

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CodePush.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,10 @@ function codePushify(options = {}) {
631631
);
632632
}
633633

634+
if (options.updateChecker && !options.releaseHistoryFetcher) {
635+
throw new Error('If you want to use `updateChecker`, pass a no-op function to releaseHistoryFetcher option. (e.g. `releaseHistoryFetcher: async () => ({})`)');
636+
}
637+
634638
sharedCodePushOptions.setReleaseHistoryFetcher(options.releaseHistoryFetcher);
635639
sharedCodePushOptions.setUpdateChecker(options.updateChecker);
636640

typings/react-native-code-push.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ export interface CodePushOptions extends SyncOptions {
5757
/**
5858
* Specifies a function to get the release history.
5959
*
60-
* (If you want to use `updateChecker`, pass no-op function.)
60+
* If you want to use `updateChecker`, pass no-op function like below.
61+
* But it is deprecated and will be removed in the next major version.
62+
*
63+
* ```ts
64+
* const codePushOptions: {
65+
* releaseHistoryFetcher: async () => ({}), // This will not be called
66+
* }
67+
* ```
6168
*/
6269
releaseHistoryFetcher: (updateRequest: UpdateCheckRequest) => Promise<ReleaseHistoryInterface>;
6370
/**

0 commit comments

Comments
 (0)