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

fix: new version

This commit is contained in:
sunnylqm
2024-01-21 14:41:06 +08:00
parent e5405b4977
commit 36533d43c4
7 changed files with 244 additions and 207 deletions

View File

@@ -1,5 +1,6 @@
import { createContext, useContext } from 'react';
import { CheckResult, ProgressData } from './type';
import { Pushy } from './client';
const empty = {};
const noop = () => {};
@@ -10,6 +11,7 @@ export const defaultContext = {
switchVersionLater: noop,
markSuccess: noop,
dismissError: noop,
downloadUpdate: noop,
};
export const PushyContext = createContext<{
@@ -21,6 +23,8 @@ export const PushyContext = createContext<{
updateInfo?: CheckResult;
lastError?: Error;
dismissError: () => void;
client?: Pushy;
downloadUpdate: () => void;
}>(defaultContext);
export const usePushy = () => useContext(PushyContext);