@tamagui/use-debounce 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.cjs +91 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +7 -0
- package/package.json +26 -0
- package/src/index.ts +89 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Nate Wienert
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
__markAsModule(target);
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, module2, desc) => {
|
|
15
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(module2))
|
|
17
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
18
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
};
|
|
22
|
+
var __toModule = (module2) => {
|
|
23
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/index.ts
|
|
27
|
+
__export(exports, {
|
|
28
|
+
debounce: () => debounce,
|
|
29
|
+
useDebounce: () => useDebounce,
|
|
30
|
+
useDebounceValue: () => useDebounceValue
|
|
31
|
+
});
|
|
32
|
+
var import_react = __toModule(require("react"));
|
|
33
|
+
function debounce(func, wait, leading) {
|
|
34
|
+
let timeout;
|
|
35
|
+
let isCancelled;
|
|
36
|
+
function debounced() {
|
|
37
|
+
isCancelled = false;
|
|
38
|
+
let context = this;
|
|
39
|
+
let args = arguments;
|
|
40
|
+
if (leading && !timeout) {
|
|
41
|
+
func.apply(context, args);
|
|
42
|
+
}
|
|
43
|
+
clearTimeout(timeout);
|
|
44
|
+
timeout = setTimeout(function() {
|
|
45
|
+
timeout = null;
|
|
46
|
+
if (!leading && !isCancelled) {
|
|
47
|
+
func.apply(context, args);
|
|
48
|
+
}
|
|
49
|
+
isCancelled = false;
|
|
50
|
+
}, wait);
|
|
51
|
+
}
|
|
52
|
+
__name(debounced, "debounced");
|
|
53
|
+
debounced.cancel = () => {
|
|
54
|
+
isCancelled = true;
|
|
55
|
+
};
|
|
56
|
+
return debounced;
|
|
57
|
+
}
|
|
58
|
+
__name(debounce, "debounce");
|
|
59
|
+
var defaultOpts = { leading: false };
|
|
60
|
+
function useDebounce(fn, wait, options = defaultOpts, mountArgs = []) {
|
|
61
|
+
const dbEffect = (0, import_react.useRef)(null);
|
|
62
|
+
(0, import_react.useEffect)(() => {
|
|
63
|
+
return () => {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = dbEffect.current) == null ? void 0 : _a.cancel();
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
return (0, import_react.useMemo)(() => {
|
|
69
|
+
dbEffect.current = debounce(fn, wait, options.leading);
|
|
70
|
+
return dbEffect.current;
|
|
71
|
+
}, [options.leading, ...mountArgs]);
|
|
72
|
+
}
|
|
73
|
+
__name(useDebounce, "useDebounce");
|
|
74
|
+
function useDebounceValue(val, amt = 0) {
|
|
75
|
+
const [state, setState] = (0, import_react.useState)(val);
|
|
76
|
+
(0, import_react.useEffect)(() => {
|
|
77
|
+
let tm = setTimeout(() => {
|
|
78
|
+
setState((prev) => {
|
|
79
|
+
if (prev === val)
|
|
80
|
+
return prev;
|
|
81
|
+
return val;
|
|
82
|
+
});
|
|
83
|
+
}, amt);
|
|
84
|
+
return () => {
|
|
85
|
+
clearTimeout(tm);
|
|
86
|
+
};
|
|
87
|
+
}, [val]);
|
|
88
|
+
return state;
|
|
89
|
+
}
|
|
90
|
+
__name(useDebounceValue, "useDebounceValue");
|
|
91
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { useEffect, useMemo, useRef, useState } from 'react'\n\ntype DebounceSettings = {\n leading?: boolean\n}\n\nexport function debounce<A extends Function>(\n func: A,\n wait?: number,\n leading?: boolean\n): A & {\n cancel: Function\n} {\n let timeout: any\n let isCancelled\n function debounced(this: any) {\n isCancelled = false\n let context = this\n let args = arguments\n if (leading && !timeout) {\n func.apply(context, args)\n }\n clearTimeout(timeout)\n timeout = setTimeout(function () {\n timeout = null\n if (!leading && !isCancelled) {\n func.apply(context, args)\n }\n isCancelled = false\n }, wait)\n }\n debounced.cancel = () => {\n isCancelled = true\n }\n return debounced as any\n}\n\nconst defaultOpts = { leading: false }\n\nexport function useDebounce<\n A extends (...args: any) => any | undefined | null,\n DebouncedFn extends A & {\n cancel: () => void\n }\n>(\n fn: A,\n wait: number,\n options: DebounceSettings = defaultOpts,\n mountArgs: any[] = []\n): DebouncedFn {\n const dbEffect = useRef<DebouncedFn | null>(null)\n\n useEffect(() => {\n return () => {\n dbEffect.current?.cancel()\n }\n }, [])\n\n return useMemo(() => {\n dbEffect.current = debounce(fn, wait, options.leading) as unknown as DebouncedFn\n return dbEffect.current\n }, [options.leading, ...mountArgs])\n}\n\n/**\n * Returns a value once it stops changing after \"amt\" time.\n * Note: you may need to memo or this will keep re-rendering\n */\nexport function useDebounceValue<A>(val: A, amt = 0): A {\n const [state, setState] = useState(val)\n\n useEffect(() => {\n let tm = setTimeout(() => {\n setState((prev) => {\n if (prev === val) return prev\n return val\n })\n }, amt)\n\n return () => {\n clearTimeout(tm)\n }\n }, [val])\n\n return state\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqD;AAM9C,kBACL,MACA,MACA,SAGA;AACA,MAAI;AACJ,MAAI;AACJ,uBAA8B;AAC5B,kBAAc;AACd,QAAI,UAAU;AACd,QAAI,OAAO;AACX,QAAI,WAAW,CAAC,SAAS;AACvB,WAAK,MAAM,SAAS;AAAA;AAEtB,iBAAa;AACb,cAAU,WAAW,WAAY;AAC/B,gBAAU;AACV,UAAI,CAAC,WAAW,CAAC,aAAa;AAC5B,aAAK,MAAM,SAAS;AAAA;AAEtB,oBAAc;AAAA,OACb;AAAA;AAdI;AAgBT,YAAU,SAAS,MAAM;AACvB,kBAAc;AAAA;AAEhB,SAAO;AAAA;AA5BO;AA+BhB,IAAM,cAAc,EAAE,SAAS;AAExB,qBAML,IACA,MACA,UAA4B,aAC5B,YAAmB,IACN;AACb,QAAM,WAAW,yBAA2B;AAE5C,8BAAU,MAAM;AACd,WAAO,MAAM;AArDjB;AAsDM,qBAAS,YAAT,mBAAkB;AAAA;AAAA,KAEnB;AAEH,SAAO,0BAAQ,MAAM;AACnB,aAAS,UAAU,SAAS,IAAI,MAAM,QAAQ;AAC9C,WAAO,SAAS;AAAA,KACf,CAAC,QAAQ,SAAS,GAAG;AAAA;AAtBV;AA6BT,0BAA6B,KAAQ,MAAM,GAAM;AACtD,QAAM,CAAC,OAAO,YAAY,2BAAS;AAEnC,8BAAU,MAAM;AACd,QAAI,KAAK,WAAW,MAAM;AACxB,eAAS,CAAC,SAAS;AACjB,YAAI,SAAS;AAAK,iBAAO;AACzB,eAAO;AAAA;AAAA,OAER;AAEH,WAAO,MAAM;AACX,mBAAa;AAAA;AAAA,KAEd,CAAC;AAEJ,SAAO;AAAA;AAhBO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
function debounce(func, wait, leading) {
|
|
5
|
+
let timeout;
|
|
6
|
+
let isCancelled;
|
|
7
|
+
function debounced() {
|
|
8
|
+
isCancelled = false;
|
|
9
|
+
let context = this;
|
|
10
|
+
let args = arguments;
|
|
11
|
+
if (leading && !timeout) {
|
|
12
|
+
func.apply(context, args);
|
|
13
|
+
}
|
|
14
|
+
clearTimeout(timeout);
|
|
15
|
+
timeout = setTimeout(function() {
|
|
16
|
+
timeout = null;
|
|
17
|
+
if (!leading && !isCancelled) {
|
|
18
|
+
func.apply(context, args);
|
|
19
|
+
}
|
|
20
|
+
isCancelled = false;
|
|
21
|
+
}, wait);
|
|
22
|
+
}
|
|
23
|
+
__name(debounced, "debounced");
|
|
24
|
+
debounced.cancel = () => {
|
|
25
|
+
isCancelled = true;
|
|
26
|
+
};
|
|
27
|
+
return debounced;
|
|
28
|
+
}
|
|
29
|
+
__name(debounce, "debounce");
|
|
30
|
+
const defaultOpts = { leading: false };
|
|
31
|
+
function useDebounce(fn, wait, options = defaultOpts, mountArgs = []) {
|
|
32
|
+
const dbEffect = useRef(null);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
return () => {
|
|
35
|
+
dbEffect.current?.cancel();
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return useMemo(() => {
|
|
39
|
+
dbEffect.current = debounce(fn, wait, options.leading);
|
|
40
|
+
return dbEffect.current;
|
|
41
|
+
}, [options.leading, ...mountArgs]);
|
|
42
|
+
}
|
|
43
|
+
__name(useDebounce, "useDebounce");
|
|
44
|
+
function useDebounceValue(val, amt = 0) {
|
|
45
|
+
const [state, setState] = useState(val);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
let tm = setTimeout(() => {
|
|
48
|
+
setState((prev) => {
|
|
49
|
+
if (prev === val)
|
|
50
|
+
return prev;
|
|
51
|
+
return val;
|
|
52
|
+
});
|
|
53
|
+
}, amt);
|
|
54
|
+
return () => {
|
|
55
|
+
clearTimeout(tm);
|
|
56
|
+
};
|
|
57
|
+
}, [val]);
|
|
58
|
+
return state;
|
|
59
|
+
}
|
|
60
|
+
__name(useDebounceValue, "useDebounceValue");
|
|
61
|
+
export {
|
|
62
|
+
debounce,
|
|
63
|
+
useDebounce,
|
|
64
|
+
useDebounceValue
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { useEffect, useMemo, useRef, useState } from 'react'\n\ntype DebounceSettings = {\n leading?: boolean\n}\n\nexport function debounce<A extends Function>(\n func: A,\n wait?: number,\n leading?: boolean\n): A & {\n cancel: Function\n} {\n let timeout: any\n let isCancelled\n function debounced(this: any) {\n isCancelled = false\n let context = this\n let args = arguments\n if (leading && !timeout) {\n func.apply(context, args)\n }\n clearTimeout(timeout)\n timeout = setTimeout(function () {\n timeout = null\n if (!leading && !isCancelled) {\n func.apply(context, args)\n }\n isCancelled = false\n }, wait)\n }\n debounced.cancel = () => {\n isCancelled = true\n }\n return debounced as any\n}\n\nconst defaultOpts = { leading: false }\n\nexport function useDebounce<\n A extends (...args: any) => any | undefined | null,\n DebouncedFn extends A & {\n cancel: () => void\n }\n>(\n fn: A,\n wait: number,\n options: DebounceSettings = defaultOpts,\n mountArgs: any[] = []\n): DebouncedFn {\n const dbEffect = useRef<DebouncedFn | null>(null)\n\n useEffect(() => {\n return () => {\n dbEffect.current?.cancel()\n }\n }, [])\n\n return useMemo(() => {\n dbEffect.current = debounce(fn, wait, options.leading) as unknown as DebouncedFn\n return dbEffect.current\n }, [options.leading, ...mountArgs])\n}\n\n/**\n * Returns a value once it stops changing after \"amt\" time.\n * Note: you may need to memo or this will keep re-rendering\n */\nexport function useDebounceValue<A>(val: A, amt = 0): A {\n const [state, setState] = useState(val)\n\n useEffect(() => {\n let tm = setTimeout(() => {\n setState((prev) => {\n if (prev === val) return prev\n return val\n })\n }, amt)\n\n return () => {\n clearTimeout(tm)\n }\n }, [val])\n\n return state\n}\n"],
|
|
5
|
+
"mappings": ";;AAAA;AAMO,kBACL,MACA,MACA,SAGA;AACA,MAAI;AACJ,MAAI;AACJ,uBAA8B;AAC5B,kBAAc;AACd,QAAI,UAAU;AACd,QAAI,OAAO;AACX,QAAI,WAAW,CAAC,SAAS;AACvB,WAAK,MAAM,SAAS;AAAA;AAEtB,iBAAa;AACb,cAAU,WAAW,WAAY;AAC/B,gBAAU;AACV,UAAI,CAAC,WAAW,CAAC,aAAa;AAC5B,aAAK,MAAM,SAAS;AAAA;AAEtB,oBAAc;AAAA,OACb;AAAA;AAdI;AAgBT,YAAU,SAAS,MAAM;AACvB,kBAAc;AAAA;AAEhB,SAAO;AAAA;AA5BO;AA+BhB,MAAM,cAAc,EAAE,SAAS;AAExB,qBAML,IACA,MACA,UAA4B,aAC5B,YAAmB,IACN;AACb,QAAM,WAAW,OAA2B;AAE5C,YAAU,MAAM;AACd,WAAO,MAAM;AACX,eAAS,SAAS;AAAA;AAAA,KAEnB;AAEH,SAAO,QAAQ,MAAM;AACnB,aAAS,UAAU,SAAS,IAAI,MAAM,QAAQ;AAC9C,WAAO,SAAS;AAAA,KACf,CAAC,QAAQ,SAAS,GAAG;AAAA;AAtBV;AA6BT,0BAA6B,KAAQ,MAAM,GAAM;AACtD,QAAM,CAAC,OAAO,YAAY,SAAS;AAEnC,YAAU,MAAM;AACd,QAAI,KAAK,WAAW,MAAM;AACxB,eAAS,CAAC,SAAS;AACjB,YAAI,SAAS;AAAK,iBAAO;AACzB,eAAO;AAAA;AAAA,OAER;AAEH,WAAO,MAAM;AACX,mBAAa;AAAA;AAAA,KAEd,CAAC;AAEJ,SAAO;AAAA;AAhBO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tamagui/use-debounce",
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
|
+
"source": "src/index.ts",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"typings": "types.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tamagui-build",
|
|
14
|
+
"watch": "tamagui-build --watch"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@tamagui/build": "^1.0.0-alpha.2"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": "*"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"gitHead": "3e3b5401f9daea70cf9a99782d325f58357ca681"
|
|
26
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
type DebounceSettings = {
|
|
4
|
+
leading?: boolean
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function debounce<A extends Function>(
|
|
8
|
+
func: A,
|
|
9
|
+
wait?: number,
|
|
10
|
+
leading?: boolean
|
|
11
|
+
): A & {
|
|
12
|
+
cancel: () => void
|
|
13
|
+
} {
|
|
14
|
+
let timeout: any
|
|
15
|
+
let isCancelled = false
|
|
16
|
+
|
|
17
|
+
function debounced(this: any) {
|
|
18
|
+
isCancelled = false
|
|
19
|
+
let context = this
|
|
20
|
+
let args = arguments
|
|
21
|
+
if (leading && !timeout) {
|
|
22
|
+
func.apply(context, args)
|
|
23
|
+
}
|
|
24
|
+
clearTimeout(timeout)
|
|
25
|
+
timeout = setTimeout(function () {
|
|
26
|
+
timeout = null
|
|
27
|
+
if (!leading && !isCancelled) {
|
|
28
|
+
func.apply(context, args)
|
|
29
|
+
}
|
|
30
|
+
isCancelled = false
|
|
31
|
+
}, wait)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
debounced.cancel = () => {
|
|
35
|
+
isCancelled = true
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return debounced as any
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const defaultOpts = { leading: false }
|
|
42
|
+
|
|
43
|
+
export function useDebounce<
|
|
44
|
+
A extends (...args: any) => any | undefined | null,
|
|
45
|
+
DebouncedFn extends A & {
|
|
46
|
+
cancel: () => void
|
|
47
|
+
}
|
|
48
|
+
>(
|
|
49
|
+
fn: A,
|
|
50
|
+
wait: number,
|
|
51
|
+
options: DebounceSettings = defaultOpts,
|
|
52
|
+
mountArgs: any[] = []
|
|
53
|
+
): DebouncedFn {
|
|
54
|
+
const dbEffect = useRef<DebouncedFn | null>(null)
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
return () => {
|
|
58
|
+
dbEffect.current?.cancel()
|
|
59
|
+
}
|
|
60
|
+
}, [])
|
|
61
|
+
|
|
62
|
+
return useMemo(() => {
|
|
63
|
+
dbEffect.current = debounce(fn, wait, options.leading) as unknown as DebouncedFn
|
|
64
|
+
return dbEffect.current
|
|
65
|
+
}, [options.leading, ...mountArgs])
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a value once it stops changing after "amt" time.
|
|
70
|
+
* Note: you may need to memo or this will keep re-rendering
|
|
71
|
+
*/
|
|
72
|
+
export function useDebounceValue<A>(val: A, amt = 0): A {
|
|
73
|
+
const [state, setState] = useState(val)
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
let tm = setTimeout(() => {
|
|
77
|
+
setState((prev) => {
|
|
78
|
+
if (prev === val) return prev
|
|
79
|
+
return val
|
|
80
|
+
})
|
|
81
|
+
}, amt)
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
clearTimeout(tm)
|
|
85
|
+
}
|
|
86
|
+
}, [val])
|
|
87
|
+
|
|
88
|
+
return state
|
|
89
|
+
}
|