v10.0.0-beta.1
This commit is contained in:
parent
40b2e9dea0
commit
e86df57476
@ -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": {
|
||||
|
@ -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);
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user