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