react-global-state-hooks 15.0.2 → 15.0.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/GlobalStore.d.ts +5 -5
- package/GlobalStore.js +1 -1
- package/GlobalStoreAbstract.d.ts +1 -1
- package/GlobalStoreAbstract.js +1 -1
- package/bundle.js +1 -1
- package/createGlobalState.d.ts +1 -1
- package/createGlobalState.js +1 -1
- package/index.d.ts +2 -2
- package/package.json +2 -2
- package/types.d.ts +1 -1
package/GlobalStore.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ export declare class GlobalStore<State, Metadata extends BaseMetadata, ActionsCo
|
|
|
11
11
|
name?: string;
|
|
12
12
|
localStorage?: LocalStorageConfig<State>;
|
|
13
13
|
});
|
|
14
|
-
protected
|
|
14
|
+
protected isPersistStorageAvailable: () => boolean;
|
|
15
15
|
protected _onInitialize: ({ getState }: StoreTools<State, PublicStateMutator, Metadata>) => void;
|
|
16
|
-
private
|
|
16
|
+
private trySetStorageItem;
|
|
17
17
|
private updateStateWithValidation;
|
|
18
18
|
protected _onChange: ({ state, }: StoreTools<State, PublicStateMutator, Metadata> & StateChanges<State>) => void;
|
|
19
19
|
/**
|
|
@@ -27,8 +27,8 @@ export declare class GlobalStore<State, Metadata extends BaseMetadata, ActionsCo
|
|
|
27
27
|
*/
|
|
28
28
|
protected onInit: (parameters: StoreTools<State, PublicStateMutator, Metadata>) => void;
|
|
29
29
|
protected onStateChanged: (args: StoreTools<State, PublicStateMutator, Metadata> & StateChanges<State>) => void;
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
30
|
+
private getStorageItem;
|
|
31
|
+
private setStorageItem;
|
|
32
|
+
private handleStorageError;
|
|
33
33
|
}
|
|
34
34
|
export default GlobalStore;
|
package/GlobalStore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,
|
|
1
|
+
var t,e;t=this,e=(t,e,o,r)=>(()=>{"use strict";var a={70:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){try{return{result:t(),error:null}}catch(t){return{result:null,error:t}}}},266:e=>{e.exports=t},330:t=>{t.exports=e},413:t=>{t.exports=o},773:t=>{t.exports=r}},n={};function l(t){var e=n[t];if(void 0!==e)return e.exports;var o=n[t]={exports:{}};return a[t](o,o.exports,l),o.exports}var i={};return(()=>{var t=i;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,o){if(o&&("object"==e(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r=function(){return!!t})()}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}var u=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStore=void 0;var s=l(266),c=u(l(70)),f=u(l(330)),d=u(l(413)),g=u(l(773)),v=function(t){function l(t){var n,i,u,s,v,S=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u=this,v=[t,S],s=a(s=l),(n=o(u,r()?Reflect.construct(s,v||[],a(u).constructor):s.apply(u,v))).localStorage=null,n.isPersistStorageAvailable=function(){var t;return Boolean((null===(t=n.localStorage)||void 0===t?void 0:t.key)&&(null===globalThis||void 0===globalThis?void 0:globalThis.localStorage))},n._onInitialize=function(t){var e=t.getState,o=n.localStorage;if(o&&n.isPersistStorageAvailable()){var r=o.versioning,a=(0,c.default)(function(){var t,e,a=null===(t=o.adapter)||void 0===t?void 0:t.getItem;return a?{s:a(o.key),v:null!==(e=null==r?void 0:r.version)&&void 0!==e?e:-1}:n.getStorageItem()}),l=a.result,i=a.error;if(i)return n.handleStorageError(i),void n.updateStateWithValidation(n.getState());if(l){var u=l.v===(null==r?void 0:r.version),s=null==r?void 0:r.migrator;if(u||!s||o.adapter)n.updateStateWithValidation(l.s);else{var f=(0,c.default)(function(){return s({legacy:l.s,initial:n.getState()})}),d=f.result,g=f.error;g?(n.handleStorageError(g),n.updateStateWithValidation(n.getState())):n.updateStateWithValidation(d)}}else n.updateStateWithValidation(e())}},n.trySetStorageItem=function(t){var e=n.localStorage;if(e){var o=(0,c.default)(function(){var o,r=null===(o=e.adapter)||void 0===o?void 0:o.setItem;if(!r)return n.setStorageItem(t);r(e.key,t)}),r=o.error;r&&n.handleStorageError(r)}},n.updateStateWithValidation=function(t){var e=n.localStorage;if(e){var o=(0,c.default)(function(){return e.validator({restored:t,initial:n.getState()})}),r=o.result,a=o.error;if(a)return n.handleStorageError(a),void n.trySetStorageItem(n.getState());if(void 0===r)return void 0===t?void n.trySetStorageItem(n.getState()):(n.setState(t),void n.trySetStorageItem(t));n.setState(r),n.trySetStorageItem(r)}},n._onChange=function(t){var e=t.state,o=n.localStorage;if(o&&n.isPersistStorageAvailable()){var r=(0,c.default)(function(){var t,r=null===(t=o.adapter)||void 0===t?void 0:t.setItem;if(r)return r(o.key,e);n.setStorageItem(e)}),a=r.error;a&&n.handleStorageError(a)}},n.onInitialize=null,n.onChange=null,n.onInit=function(t){var e;null===(e=n._onInitialize)||void 0===e||e.call(n,t)},n.onStateChanged=function(t){var e;null===(e=n._onChange)||void 0===e||e.call(n,t)},n.getStorageItem=function(){var t=globalThis.localStorage.getItem(n.localStorage.key),o=(0,g.default)(t)?null:(0,f.default)(t);return function(t,o){if(!((0,g.default)(o)||"object"===e(o)&&"s"in o&&"v"in o))throw new Error('[react-native-global-state-hooks] The value of the key "'.concat(t,'" is not a valid storage envelope.'))}(n.localStorage.key,o),o},n.setStorageItem=function(t){var e,o,r,a={s:t,v:null!==(r=null===(o=null===(e=n.localStorage)||void 0===e?void 0:e.versioning)||void 0===o?void 0:o.version)&&void 0!==r?r:-1},l=(0,d.default)(a);globalThis.localStorage.setItem(n.localStorage.key,l)},n.handleStorageError=function(t){var e,o;if(null===(e=n.localStorage)||void 0===e?void 0:e.onError)return n.localStorage.onError(t);globalThis.console.error(["[react-global-state-hooks]\n"," localStorage sync error:","[hook]:"," ".concat(n._name),"[Localstorage Key]:"," ".concat(null===(o=n.localStorage)||void 0===o?void 0:o.key),"[Error]:"," ".concat(null!=t?t:"undefined","\n\n"),"Stacktrace:"].join("\n"),t.stack)},n.localStorage=null!==(i=S.localStorage)&&void 0!==i?i:null,n.constructor!==l?o(n):(n.initialize(),n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}(l,t),i=l,Object.defineProperty(i,"prototype",{writable:!1}),i;var i}(s.GlobalStoreAbstract);t.GlobalStore=v,t.default=v})(),i})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/GlobalStoreAbstract"),require("json-storage-formatter/formatFromStore"),require("json-storage-formatter/formatToStore"),require("json-storage-formatter/isNil")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/GlobalStoreAbstract","json-storage-formatter/formatFromStore","json-storage-formatter/formatToStore","json-storage-formatter/isNil"],e):"object"==typeof exports?exports["react-global-state-hooks"]=e(require("react-hooks-global-states/GlobalStoreAbstract"),require("json-storage-formatter/formatFromStore"),require("json-storage-formatter/formatToStore"),require("json-storage-formatter/isNil")):t["react-global-state-hooks"]=e(t["react-hooks-global-states/GlobalStoreAbstract"],t["json-storage-formatter/formatFromStore"],t["json-storage-formatter/formatToStore"],t["json-storage-formatter/isNil"]);
|
package/GlobalStoreAbstract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActionCollectionConfig, ActionCollectionResult, BaseMetadata, StateChanges, StoreTools } from 'react-hooks-global-states/types';
|
|
2
|
-
import
|
|
2
|
+
import GlobalStore from './GlobalStore';
|
|
3
3
|
export declare abstract class GlobalStoreAbstract<State, Metadata extends BaseMetadata, ActionsConfig extends ActionCollectionConfig<State, Metadata> | null | {}, PublicStateMutator = keyof ActionsConfig extends never | undefined ? React.Dispatch<React.SetStateAction<State>> : ActionCollectionResult<State, Metadata, NonNullable<ActionsConfig>>> extends GlobalStore<State, Metadata, ActionsConfig> {
|
|
4
4
|
protected onInit: (args: StoreTools<State, PublicStateMutator, Metadata>) => void;
|
|
5
5
|
onStateChanged: (args: StoreTools<State, PublicStateMutator, Metadata> & StateChanges<State>) => void;
|
package/GlobalStoreAbstract.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;t=t=>(()=>{"use strict";var e={778:e=>{e.exports=t}},o={};function r(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function
|
|
1
|
+
var t;t=t=>(()=>{"use strict";var e={778:e=>{e.exports=t}},o={};function r(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!t})()}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStoreAbstract=void 0;var c,l=function(t){function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=function(t,r,n){return r=i(r),function(t,o){if(o&&("object"==e(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(r,n||[],i(t).constructor):r.apply(t,n))}(this,r,arguments)).onInit=function(e){var o;t._onInitialize(e),null===(o=t.onInitialize)||void 0===o||o.call(t,e)},t.onStateChanged=function(e){var o;t._onInitialize(e),null===(o=t.onChange)||void 0===o||o.call(t,e)},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(r,t),n=r,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}((c=r(778),c&&c.__esModule?c:{default:c}).default);t.GlobalStoreAbstract=l,t.default=l})(),n})(),"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./GlobalStore.js")):"function"==typeof define&&define.amd?define(["./GlobalStore.js"],t):"object"==typeof exports?exports["react-global-state-hooks"]=t(require("./GlobalStore.js")):this["react-global-state-hooks"]=t(this["./GlobalStore.js"]);
|
package/bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,r;e=this,r=(e,r,t,o,n,a,l,i)=>(()=>{"use strict";var s={78:r=>{r.exports=e},361:e=>{e.exports=r},487:e=>{e.exports=t},623:e=>{e.exports=o},670:e=>{e.exports=n},673:e=>{e.exports=a},778:e=>{e.exports=l},804:e=>{e.exports=i}},c={};function u(e){var r=c[e];if(void 0!==r)return r.exports;var t=c[e]={exports:{}};return s[e](t,t.exports,u),t.exports}var b={};return(()=>{var e=b;Object.defineProperty(e,"__esModule",{value:!0}),e.createGlobalState=e.GlobalStoreAbstract=e.GlobalStore=e.createContext=e.isRecord=e.throwWrongKeyOnActionCollectionConfig=e.uniqueId=e.shallowCompare=void 0;var r=u(673);Object.defineProperty(e,"shallowCompare",{enumerable:!0,get:function(){return r.shallowCompare}});var t=u(78);Object.defineProperty(e,"uniqueId",{enumerable:!0,get:function(){return t.uniqueId}});var o=u(361);Object.defineProperty(e,"throwWrongKeyOnActionCollectionConfig",{enumerable:!0,get:function(){return o.throwWrongKeyOnActionCollectionConfig}});var n=u(487);Object.defineProperty(e,"isRecord",{enumerable:!0,get:function(){return n.isRecord}});var a=u(623);Object.defineProperty(e,"createContext",{enumerable:!0,get:function(){return a.createContext}});var l=u(778);Object.defineProperty(e,"GlobalStore",{enumerable:!0,get:function(){return
|
|
1
|
+
var e,r;e=this,r=(e,r,t,o,n,a,l,i)=>(()=>{"use strict";var s={78:r=>{r.exports=e},361:e=>{e.exports=r},487:e=>{e.exports=t},623:e=>{e.exports=o},670:e=>{e.exports=n},673:e=>{e.exports=a},778:e=>{e.exports=l},804:e=>{e.exports=i}},c={};function u(e){var r=c[e];if(void 0!==r)return r.exports;var t=c[e]={exports:{}};return s[e](t,t.exports,u),t.exports}var b={};return(()=>{var e=b;Object.defineProperty(e,"__esModule",{value:!0}),e.createGlobalState=e.GlobalStoreAbstract=e.GlobalStore=e.createContext=e.isRecord=e.throwWrongKeyOnActionCollectionConfig=e.uniqueId=e.shallowCompare=void 0;var r=u(673);Object.defineProperty(e,"shallowCompare",{enumerable:!0,get:function(){return r.shallowCompare}});var t=u(78);Object.defineProperty(e,"uniqueId",{enumerable:!0,get:function(){return t.uniqueId}});var o=u(361);Object.defineProperty(e,"throwWrongKeyOnActionCollectionConfig",{enumerable:!0,get:function(){return o.throwWrongKeyOnActionCollectionConfig}});var n=u(487);Object.defineProperty(e,"isRecord",{enumerable:!0,get:function(){return n.isRecord}});var a=u(623);Object.defineProperty(e,"createContext",{enumerable:!0,get:function(){return a.createContext}});var l=u(778);Object.defineProperty(e,"GlobalStore",{enumerable:!0,get:function(){return(e=l,e&&e.__esModule?e:{default:e}).default;var e}});var i=u(804);Object.defineProperty(e,"GlobalStoreAbstract",{enumerable:!0,get:function(){return i.GlobalStoreAbstract}});var s=u(670);Object.defineProperty(e,"createGlobalState",{enumerable:!0,get:function(){return s.createGlobalState}})})(),b})(),"object"==typeof exports&&"object"==typeof module?module.exports=r(require("./uniqueId.js"),require("./throwWrongKeyOnActionCollectionConfig.js"),require("./isRecord.js"),require("./createContext.js"),require("./createGlobalState.js"),require("./shallowCompare.js"),require("./GlobalStore.js"),require("./GlobalStoreAbstract.js")):"function"==typeof define&&define.amd?define(["./uniqueId.js","./throwWrongKeyOnActionCollectionConfig.js","./isRecord.js","./createContext.js","./createGlobalState.js","./shallowCompare.js","./GlobalStore.js","./GlobalStoreAbstract.js"],r):"object"==typeof exports?exports["react-global-state-hooks"]=r(require("./uniqueId.js"),require("./throwWrongKeyOnActionCollectionConfig.js"),require("./isRecord.js"),require("./createContext.js"),require("./createGlobalState.js"),require("./shallowCompare.js"),require("./GlobalStore.js"),require("./GlobalStoreAbstract.js")):e["react-global-state-hooks"]=r(e["./uniqueId.js"],e["./throwWrongKeyOnActionCollectionConfig.js"],e["./isRecord.js"],e["./createContext.js"],e["./createGlobalState.js"],e["./shallowCompare.js"],e["./GlobalStore.js"],e["./GlobalStoreAbstract.js"]);
|
package/createGlobalState.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { StateHook, BaseMetadata, ActionCollectionConfig, ActionCollectionResult, GlobalStoreCallbacks } from 'react-hooks-global-states/types';
|
|
3
|
-
export type { InferActionsType } from 'react-hooks-global-states/createGlobalState';
|
|
3
|
+
export type { InferActionsType, InferStateApi } from 'react-hooks-global-states/createGlobalState';
|
|
4
4
|
import type { LocalStorageConfig } from './types';
|
|
5
5
|
interface CreateGlobalState {
|
|
6
6
|
/**
|
package/createGlobalState.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e;e=e=>(()=>{"use strict";var t={778:t=>{t.exports=e},840:(e,t,o)=>{function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(n=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0}),t.createGlobalState=void 0;var a=o(778);t.createGlobalState=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(e,t,o){if(n())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var l=new(e.bind.apply(e,a));return o&&r(l,o.prototype),l}(
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={778:t=>{t.exports=e},840:(e,t,o)=>{function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(n=function(){return!!e})()}Object.defineProperty(t,"__esModule",{value:!0}),t.createGlobalState=void 0;var a,l=(a=o(778))&&a.__esModule?a:{default:a};t.createGlobalState=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(e,t,o){if(n())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var l=new(e.bind.apply(e,a));return o&&r(l,o.prototype),l}(l.default,t).use},t.default=t.createGlobalState}},o={};return function e(r){var n=o[r];if(void 0!==n)return n.exports;var a=o[r]={exports:{}};return t[r](a,a.exports,e),a.exports}(840)})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./GlobalStore.js")):"function"==typeof define&&define.amd?define(["./GlobalStore.js"],e):"object"==typeof exports?exports["react-global-state-hooks"]=e(require("./GlobalStore.js")):this["react-global-state-hooks"]=e(this["./GlobalStore.js"]);
|
package/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export { throwWrongKeyOnActionCollectionConfig } from './throwWrongKeyOnActionCo
|
|
|
9
9
|
export { isRecord } from './isRecord';
|
|
10
10
|
export { type ContextProvider, type ContextHook, type InferContextApi, createContext } from './createContext';
|
|
11
11
|
export { type LocalStorageConfig } from './types';
|
|
12
|
-
export { GlobalStore } from './GlobalStore';
|
|
12
|
+
export { default as GlobalStore } from './GlobalStore';
|
|
13
13
|
export { GlobalStoreAbstract } from './GlobalStoreAbstract';
|
|
14
|
-
export { createGlobalState, type InferActionsType } from './createGlobalState';
|
|
14
|
+
export { createGlobalState, type InferActionsType, type InferStateApi } from './createGlobalState';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-global-state-hooks",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.4",
|
|
4
4
|
"description": "This is a package to easily handling global-state across your react components",
|
|
5
5
|
"main": "./bundle.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
},
|
|
151
151
|
"dependencies": {
|
|
152
152
|
"json-storage-formatter": "^3.0.2",
|
|
153
|
-
"react-hooks-global-states": "^15.0.
|
|
153
|
+
"react-hooks-global-states": "^15.0.3"
|
|
154
154
|
},
|
|
155
155
|
"peerDependencies": {
|
|
156
156
|
"json-storage-formatter": "^3.0.2",
|
package/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type LocalStorageConfig<State> = {
|
|
|
10
10
|
/**
|
|
11
11
|
* @description Validator function to ensure the integrity of the restored state.
|
|
12
12
|
* Receives the restored value and the initial state... If the function returns a value then
|
|
13
|
-
* that value is used as the new state. If it returns `void` (undefined) then the
|
|
13
|
+
* that value is used as the new state. If it returns `void` (undefined) then the restored state is used
|
|
14
14
|
* and the localStorage is updated accordingly.
|
|
15
15
|
*
|
|
16
16
|
* Executes after every initialization from localStorage, including after migration.
|