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