simpler-state
Advanced tools
Comparing version 2.0.0-pre.4 to 2.0.0-pre.5
@@ -50,3 +50,3 @@ import { strictEqual } from './equality'; | ||
if (alias !== '@@DEVTOOLS') onSet(entity, alias !== null && alias !== void 0 ? alias : '<anonymous>'); | ||
if (alias !== '@@DEVTOOLS') onSet(entity, alias ?? '<anonymous>'); | ||
}; | ||
@@ -53,0 +53,0 @@ } |
@@ -40,7 +40,5 @@ function getLocalStorage() { | ||
export default function persistence(key, options = {}) { | ||
var _a; | ||
if (typeof key !== 'string') throw new Error('Persistence requires a string key.'); | ||
let storage; | ||
const storageOption = (_a = options.storage) !== null && _a !== void 0 ? _a : 'local'; | ||
const storageOption = options.storage ?? 'local'; | ||
if (storageOption === 'local') storage = getLocalStorage();else if (storageOption === 'session') storage = getSessionStorage();else storage = validateCustomStorage(storageOption); | ||
@@ -47,0 +45,0 @@ |
@@ -10,7 +10,7 @@ import { getMutableMap, initRegistry, updateRegistry, watchRegistry } from './registry'; | ||
export function initInspector() { | ||
var _a, _b; | ||
var _window$__REDUX_DEVTO; | ||
devTools = (_b = (_a = window.__REDUX_DEVTOOLS_EXTENSION__) === null || _a === void 0 ? void 0 : _a.connect({ | ||
devTools = ((_window$__REDUX_DEVTO = window.__REDUX_DEVTOOLS_EXTENSION__) == null ? void 0 : _window$__REDUX_DEVTO.connect({ | ||
name: document.title | ||
})) !== null && _b !== void 0 ? _b : null; | ||
})) ?? null; | ||
@@ -17,0 +17,0 @@ if (devTools) { |
@@ -70,3 +70,3 @@ "use strict"; | ||
if (alias !== '@@DEVTOOLS') (0, _inspector.onSet)(entity, alias !== null && alias !== void 0 ? alias : '<anonymous>'); | ||
if (alias !== '@@DEVTOOLS') (0, _inspector.onSet)(entity, alias != null ? alias : '<anonymous>'); | ||
}; | ||
@@ -73,0 +73,0 @@ } |
@@ -47,2 +47,4 @@ "use strict"; | ||
function persistence(key, options) { | ||
var _options$storage; | ||
if (options === void 0) { | ||
@@ -52,7 +54,5 @@ options = {}; | ||
var _a; | ||
if (typeof key !== 'string') throw new Error('Persistence requires a string key.'); | ||
var storage; | ||
var storageOption = (_a = options.storage) !== null && _a !== void 0 ? _a : 'local'; | ||
var storageOption = (_options$storage = options.storage) != null ? _options$storage : 'local'; | ||
if (storageOption === 'local') storage = getLocalStorage();else if (storageOption === 'session') storage = getSessionStorage();else storage = validateCustomStorage(storageOption); | ||
@@ -59,0 +59,0 @@ |
@@ -25,7 +25,7 @@ "use strict"; | ||
function initInspector() { | ||
var _a, _b; | ||
var _window$__REDUX_DEVTO, _window$__REDUX_DEVTO2; | ||
devTools = (_b = (_a = window.__REDUX_DEVTOOLS_EXTENSION__) === null || _a === void 0 ? void 0 : _a.connect({ | ||
devTools = (_window$__REDUX_DEVTO = (_window$__REDUX_DEVTO2 = window.__REDUX_DEVTOOLS_EXTENSION__) == null ? void 0 : _window$__REDUX_DEVTO2.connect({ | ||
name: document.title | ||
})) !== null && _b !== void 0 ? _b : null; | ||
})) != null ? _window$__REDUX_DEVTO : null; | ||
@@ -32,0 +32,0 @@ if (devTools) { |
{ | ||
"name": "simpler-state", | ||
"version": "2.0.0-pre.4", | ||
"version": "2.0.0-pre.5", | ||
"description": "The simplest app state management for React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
785