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", "name": "react-native-update",
"version": "10.0.0-beta.0", "version": "10.0.0-beta.1",
"description": "react-native hot update", "description": "react-native hot update",
"main": "src/index.ts", "main": "src/index.ts",
"scripts": { "scripts": {

View File

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

View File

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

2369
yarn.lock

File diff suppressed because it is too large Load Diff