svelte-persisted-store
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -25,2 +25,2 @@ import { Writable } from 'svelte/store'; | ||
export { type Options, type Serializer, type StorageType, persisted, writable }; | ||
export { type Options, type Persisted, type Serializer, type StorageType, persisted, writable }; |
@@ -16,4 +16,3 @@ // index.ts | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
if (options == null ? void 0 : options.onError) | ||
console.warn("onError has been deprecated. Please use onWriteError instead"); | ||
if (options == null ? void 0 : options.onError) console.warn("onError has been deprecated. Please use onWriteError instead"); | ||
const serializer = (_a = options == null ? void 0 : options.serializer) != null ? _a : JSON; | ||
@@ -45,7 +44,5 @@ const storageType = (_b = options == null ? void 0 : options.storage) != null ? _b : "local"; | ||
const json = storage == null ? void 0 : storage.getItem(key); | ||
if (json == null) | ||
return initialValue; | ||
if (json == null) return initialValue; | ||
const serialized = serialize(json); | ||
if (serialized == null) | ||
return initialValue; | ||
if (serialized == null) return initialValue; | ||
const newVal = beforeRead(serialized); | ||
@@ -52,0 +49,0 @@ return newVal; |
{ | ||
"name": "svelte-persisted-store", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"license": "MIT", | ||
@@ -31,4 +31,4 @@ "type": "module", | ||
"devDependencies": { | ||
"@babel/core": "^7.24.4", | ||
"@babel/preset-env": "^7.24.5", | ||
"@babel/core": "^7.24.6", | ||
"@babel/preset-env": "^7.24.7", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
@@ -39,14 +39,14 @@ "@typescript-eslint/parser": "^5.62.0", | ||
"eslint": "^8.57.0", | ||
"jsdom": "^24.0.0", | ||
"jsdom": "^24.1.0", | ||
"publint": "^0.2.8", | ||
"rollup": "^3.28.1", | ||
"rollup-plugin-svelte": "^7.1.0", | ||
"rollup": "^4.18.0", | ||
"rollup-plugin-svelte": "^7.2.0", | ||
"semantic-release": "23.0.8", | ||
"svelte": "^4.2.1", | ||
"tsup": "^8.0.2", | ||
"typescript": "^4.9.5", | ||
"svelte": "^4.2.18", | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"svelte": "^3.48.0 || ^4.0.0 || ^5.0.0-next.0" | ||
"svelte": "^3.48.0 || ^4 || ^5" | ||
}, | ||
@@ -53,0 +53,0 @@ "keywords": [ |
@@ -38,2 +38,3 @@ [![npm version](https://img.shields.io/npm/v/svelte-persisted-store.svg)](https://www.npmjs.com/package/svelte-persisted-store) [![license](https://img.shields.io/npm/l/svelte-persisted-store.svg)](LICENSE.md) [![codecov](https://codecov.io/gh/joshnuss/svelte-persisted-store/branch/master/graph/badge.svg?token=GU607D2YRQ)](https://codecov.io/gh/joshnuss/svelte-persisted-store) | ||
preferences.set(...) // set value | ||
preferences.reset() // reset to initial value | ||
get(preferences) // read value | ||
@@ -40,0 +41,0 @@ $preferences // read value with automatic subscription |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29408
63
236