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

Compare commits

..

2 Commits

Author SHA1 Message Date
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 6 additions and 6 deletions

View File

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

View File

@@ -2,28 +2,28 @@ 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,
downloadUpdate: asyncNoop,
downloadAndInstallApk: noop,
currentHash: '',
packageVersion: '',
};
export const PushyContext = createContext<{
checkUpdate: () => void;
checkUpdate: () => Promise<void>;
switchVersion: () => void;
switchVersionLater: () => void;
markSuccess: () => void;
dismissError: () => void;
downloadUpdate: () => void;
downloadUpdate: () => Promise<void>;
downloadAndInstallApk: (url: string) => void;
currentHash: string;
packageVersion: string;