@solid-primitives/storage
Advanced tools
Comparing version
import * as solid_js from 'solid-js'; | ||
import { S as StorageWithOptions, d as StorageProps, e as StorageObject, f as StorageSetter, l as StorageActions, k as StorageSignalProps } from './types-ccd8ee35'; | ||
import { S as StorageWithOptions, d as StorageProps, e as StorageObject, f as StorageSetter, l as StorageActions, k as StorageSignalProps } from './types-d16b1c57'; | ||
@@ -4,0 +4,0 @@ declare type CookieOptions = { |
@@ -5,4 +5,4 @@ import { | ||
createCookieStorageSignal | ||
} from "./chunk-F7GMIMY5.js"; | ||
import "./chunk-KCTTCEBZ.js"; | ||
} from "./chunk-P74J3DHA.js"; | ||
import "./chunk-2WVZGT66.js"; | ||
import "./chunk-UHHZE4FR.js"; | ||
@@ -9,0 +9,0 @@ import "./chunk-JUWXSDKJ.js"; |
@@ -1,2 +0,2 @@ | ||
export { A as AnyStorageProps, g as AsyncStorage, i as AsyncStorageObject, j as AsyncStorageSetter, h as AsyncStorageWithOptions, a as StorageDeserializer, e as StorageObject, d as StorageProps, b as StorageSerializer, f as StorageSetter, k as StorageSignalProps, S as StorageWithOptions, c as StringStorageProps } from './types-ccd8ee35'; | ||
export { A as AnyStorageProps, g as AsyncStorage, i as AsyncStorageObject, j as AsyncStorageSetter, h as AsyncStorageWithOptions, a as StorageDeserializer, e as StorageObject, d as StorageProps, b as StorageSerializer, f as StorageSetter, k as StorageSignalProps, S as StorageWithOptions, c as StringStorageProps } from './types-d16b1c57'; | ||
export { createAsyncStorage, createLocalStorage, createSessionStorage, createStorage, createStorageSignal } from './storage'; | ||
@@ -3,0 +3,0 @@ export { CookieOptions, cookieStorage, createCookieStorage } from './cookies'; |
import { | ||
cookieStorage, | ||
createCookieStorage | ||
} from "./chunk-F7GMIMY5.js"; | ||
} from "./chunk-P74J3DHA.js"; | ||
import { | ||
@@ -11,3 +11,3 @@ createAsyncStorage, | ||
createStorageSignal | ||
} from "./chunk-KCTTCEBZ.js"; | ||
} from "./chunk-2WVZGT66.js"; | ||
import { | ||
@@ -14,0 +14,0 @@ addClearMethod |
import { Accessor, Setter } from 'solid-js'; | ||
import { c as StringStorageProps, S as StorageWithOptions, e as StorageObject, f as StorageSetter, l as StorageActions, A as AnyStorageProps, g as AsyncStorage, h as AsyncStorageWithOptions, i as AsyncStorageObject, j as AsyncStorageSetter, m as AsyncStorageActions, k as StorageSignalProps, d as StorageProps } from './types-ccd8ee35'; | ||
import { c as StringStorageProps, S as StorageWithOptions, e as StorageObject, f as StorageSetter, l as StorageActions, A as AnyStorageProps, g as AsyncStorage, h as AsyncStorageWithOptions, i as AsyncStorageObject, j as AsyncStorageSetter, m as AsyncStorageActions, k as StorageSignalProps, d as StorageProps } from './types-d16b1c57'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -7,3 +7,3 @@ import { | ||
createStorageSignal | ||
} from "./chunk-KCTTCEBZ.js"; | ||
} from "./chunk-2WVZGT66.js"; | ||
import "./chunk-JUWXSDKJ.js"; | ||
@@ -10,0 +10,0 @@ export { |
@@ -1,2 +0,2 @@ | ||
import { S as StorageWithOptions } from './types-ccd8ee35'; | ||
import { S as StorageWithOptions } from './types-d16b1c57'; | ||
@@ -3,0 +3,0 @@ /** |
{ | ||
"name": "@solid-primitives/storage", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Primitive that provides reactive wrappers for storage access", | ||
"author": "Alex Lohr <alex.lohr@logmein.com>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/davedbase/solid-primitives/tree/main/packages/storage", | ||
"homepage": "https://github.com/solidjs-community/solid-primitives/tree/main/packages/storage", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/davedbase/solid-primitives.git" | ||
"url": "git+https://github.com/solidjs-community/solid-primitives.git" | ||
}, | ||
@@ -46,5 +46,5 @@ "primitive": { | ||
"devDependencies": { | ||
"jsdom": "18.1.1", | ||
"jsdom": "^19.0.0", | ||
"prettier": "^2.0.5", | ||
"solid-register": "0.1.5", | ||
"solid-register": "^0.1.5", | ||
"tsup": "^5.10.1", | ||
@@ -51,0 +51,0 @@ "typescript": "^4.5.2", |
@@ -0,1 +1,5 @@ | ||
<p> | ||
<img width="100%" src="https://assets.solidjs.com/banner?type=Primitives&background=tiles&project=Storage" alt="Solid Primitives Storage"> | ||
</p> | ||
# @solid-primitives/storage | ||
@@ -6,3 +10,3 @@ | ||
[](https://www.npmjs.com/package/@solid-primitives/storage) | ||
[](https://github.com/davedbase/solid-primitives#contribution-process) | ||
[](https://github.com/solidjs-community/solid-primitives#contribution-process) | ||
@@ -100,3 +104,3 @@ Creates a primitive to reactively access both synchronous and asynchronous persistent storage APIs similar to localStorage. | ||
toJSON: () => ({ [key: string]: string }); | ||
}] = createAsyncStorage({ api: CookieStoreAPI, prefix: 'my-app' }); | ||
}] = createAsyncStorage({ api: CookieStoreAPI, prefix: 'my-app', sync: false }); | ||
@@ -146,2 +150,13 @@ await setStore('key', 'value'); | ||
### Options | ||
The properties of your `createStorage`/`createAsyncStorage`/`createStorageSignal` props are: | ||
* `api`: the (sync or async) [Storage-like API](https://developer.mozilla.org/de/docs/Web/API/Web_Storage_API), default is localStorage | ||
* `deserializer` (optional): a deserializer or parser for the stored data | ||
* `serializer` (optional): a serializer or string converter for the stored data | ||
* `options` (optional): default options for the set-call of Storage-like API, if supported | ||
* `prefix` (optional): a prefix for the Storage keys | ||
* `sync` (optional): if set to false, [event synchronization](https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent) is disabled | ||
### Tools | ||
@@ -188,2 +203,5 @@ | ||
1.1.2 | ||
Added sync option to disable event synching | ||
</details> |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
73965
3.42%1721
1.06%204
9.68%1
Infinity%