1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

v10.0.0-beta.1

This commit is contained in:
sunnylqm 2024-01-22 15:34:54 +08:00
parent 40b2e9dea0
commit e86df57476
No known key found for this signature in database
4 changed files with 838 additions and 1549 deletions

View File

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

View File

@ -12,19 +12,23 @@ export const defaultContext = {
markSuccess: noop,
dismissError: noop,
downloadUpdate: noop,
currentHash: '',
packageVersion: '',
};
export const PushyContext = createContext<{
checkUpdate: () => void;
switchVersion: () => void;
switchVersionLater: () => void;
progress?: ProgressData;
markSuccess: () => void;
dismissError: () => void;
downloadUpdate: () => void;
currentHash: string;
packageVersion: string;
client?: Pushy;
progress?: ProgressData;
updateInfo?: CheckResult;
lastError?: Error;
dismissError: () => void;
client?: Pushy;
downloadUpdate: () => void;
}>(defaultContext);
export const usePushy = () => useContext(PushyContext);

View File

@ -13,7 +13,7 @@ import {
Linking,
} from 'react-native';
import { Pushy } from './client';
import { isFirstTime } from './core';
import { currentVersion, isFirstTime, packageVersion } from './core';
import { CheckResult } from './type';
import { PushyContext } from './context';
@ -176,6 +176,8 @@ export const PushyProvider = ({
markSuccess,
client,
downloadUpdate,
packageVersion,
currentHash: currentVersion,
}}
>
{children}

2369
yarn.lock

File diff suppressed because it is too large Load Diff