mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-17 21:56:11 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
68a6235145 | ||
![]() |
a98a48d665 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update",
|
||||
"version": "10.1.0",
|
||||
"version": "10.1.1",
|
||||
"description": "react-native hot update",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
|
@@ -2,28 +2,28 @@ import { createContext, useContext } from 'react';
|
||||
import { CheckResult, ProgressData } from './type';
|
||||
import { Pushy } from './client';
|
||||
|
||||
const empty = {};
|
||||
const noop = () => {};
|
||||
const asyncNoop = () => Promise.resolve();
|
||||
|
||||
export const defaultContext = {
|
||||
checkUpdate: () => Promise.resolve(empty),
|
||||
checkUpdate: asyncNoop,
|
||||
switchVersion: noop,
|
||||
switchVersionLater: noop,
|
||||
markSuccess: noop,
|
||||
dismissError: noop,
|
||||
downloadUpdate: noop,
|
||||
downloadUpdate: asyncNoop,
|
||||
downloadAndInstallApk: noop,
|
||||
currentHash: '',
|
||||
packageVersion: '',
|
||||
};
|
||||
|
||||
export const PushyContext = createContext<{
|
||||
checkUpdate: () => void;
|
||||
checkUpdate: () => Promise<void>;
|
||||
switchVersion: () => void;
|
||||
switchVersionLater: () => void;
|
||||
markSuccess: () => void;
|
||||
dismissError: () => void;
|
||||
downloadUpdate: () => void;
|
||||
downloadUpdate: () => Promise<void>;
|
||||
downloadAndInstallApk: (url: string) => void;
|
||||
currentHash: string;
|
||||
packageVersion: string;
|
||||
|
Reference in New Issue
Block a user