parsec-hooks 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
declare const _default: <D extends unknown>(name: string, initState?: D) => [D, Dispatch<SetStateAction<D>>];
|
1
|
+
declare const _default: <D extends unknown>(name: string, initState?: D) => [D, (state: D) => void];
|
3
2
|
/**
|
4
3
|
* 在每个需要的地方使用传入,得到一个全局的状态,如:
|
5
4
|
* const globalLoading = useGlobalState('globalLoading')
|
@@ -35,13 +35,13 @@ var _default = function _default(name, initState) {
|
|
35
35
|
(0, _react.useLayoutEffect)(function () {
|
36
36
|
globalObj[name].sets.push(setGlobalState);
|
37
37
|
}, [name]);
|
38
|
-
|
38
|
+
return [globalState, function (state) {
|
39
|
+
globalObj[name].state = state;
|
40
|
+
setGlobalState(state);
|
39
41
|
globalObj[name].sets.forEach(function (fn) {
|
40
|
-
return fn(
|
42
|
+
return fn(state);
|
41
43
|
});
|
42
|
-
|
43
|
-
}, [globalState, name]);
|
44
|
-
return [globalState, setGlobalState];
|
44
|
+
}];
|
45
45
|
};
|
46
46
|
|
47
47
|
exports.default = _default;
|
@@ -5,10 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
+
var _wechat = require("remax-rn/src/wechat");
|
9
|
+
|
8
10
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
9
11
|
// @ts-ignore
|
10
|
-
|
11
|
-
|
12
|
+
var _default = function _default(pageName) {
|
13
|
+
(0, _wechat.setNavigationBarTitle)({
|
14
|
+
title: pageName
|
15
|
+
});
|
12
16
|
};
|
13
17
|
|
14
18
|
exports.default = _default;
|