1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-17 16:46:09 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

..

4 Commits

Author SHA1 Message Date
sunnylqm
ab9c40bf2e v10.1.2 2024-02-25 00:05:14 +08:00
sunnylqm
d184beabaf fix: type 2024-02-25 00:04:55 +08:00
sunnylqm
68a6235145 v10.1.1 2024-02-25 00:03:58 +08:00
sunnylqm
a98a48d665 fix: type 2024-02-25 00:03:35 +08:00
2 changed files with 8 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-update",
"version": "10.1.0",
"version": "10.1.2",
"description": "react-native hot update",
"main": "src/index.ts",
"scripts": {

View File

@@ -2,29 +2,29 @@ import { createContext, useContext } from 'react';
import { CheckResult, ProgressData } from './type';
import { Pushy } from './client';
const empty = {};
const noop = () => {};
const asyncNoop = () => Promise.resolve();
export const defaultContext = {
checkUpdate: () => Promise.resolve(empty),
checkUpdate: asyncNoop,
switchVersion: noop,
switchVersionLater: noop,
markSuccess: noop,
dismissError: noop,
downloadUpdate: noop,
downloadAndInstallApk: noop,
downloadUpdate: asyncNoop,
downloadAndInstallApk: asyncNoop,
currentHash: '',
packageVersion: '',
};
export const PushyContext = createContext<{
checkUpdate: () => void;
checkUpdate: () => Promise<void>;
switchVersion: () => void;
switchVersionLater: () => void;
markSuccess: () => void;
dismissError: () => void;
downloadUpdate: () => void;
downloadAndInstallApk: (url: string) => void;
downloadUpdate: () => Promise<void>;
downloadAndInstallApk: (url: string) => Promise<void>;
currentHash: string;
packageVersion: string;
client?: Pushy;