Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@effector-storage/idb-keyval
Advanced tools
Adapter to persist store in IndexedDB, using idb-keyval library.
Depending on your package manager
# using `pnpm` ↓
$ pnpm add effector-storage @effector-storage/idb-keyval
# using `yarn` ↓
$ yarn add effector-storage @effector-storage/idb-keyval
# using `npm` ↓
$ npm install --save effector-storage @effector-storage/idb-keyval
Import persist
function from '@effector-storage/idb-keyval'
module, and it will just work:
import { persist } from '@effector-storage/idb-keyval'
// persist store `$counter` with key 'counter'
persist({ store: $counter, key: 'counter' })
// if your storage has a name, you can omit `key` field
persist({ store: $counter })
⚠️ Note, that IndexedDB is asynchronous.
Two (or more) different stores, persisted with the same key, will be synchronized (synchronously!), even if not connected with each other directly — each store will receive updates from another one.
import { persist } from '@effector-storage/idb-keyval'
persist({ store, ...options }): Subscription
persist({ source, target, ...options }): Subscription
effector-storage
's persist
function.timeout
?: (number): Timeout in milliseconds, which will be used to throttle and batch updates. Default = undefined
(meaning updates will be saved immediately)dbName
?: (string): IndexedDB database name. Default = undefined
(in that case default idb-keyval
database will be used — 'keyval-store'
)storeName
?: (string): IndexedDB store name. Default = undefined
(in that case default idb-keyval
store will be used — 'keyval'
)keyvalStore
?: (UseStore): Custom idb-keyval
store. Default = undefined
(in that case default idb-keyval
store will be used)import { adapter } from '@effector-storage/idb-keyval'
adapter(options?): StorageAdapter
timeout
?: (number): Timeout in milliseconds, which will be used to throttle and batch updates. Default = undefined
(meaning updates will be saved immediately)dbName
?: (string): IndexedDB database name. Default = undefined
(in that case default idb-keyval
database will be used — 'keyval-store'
)storeName
?: (string): IndexedDB store name. Default = undefined
(in that case default idb-keyval
store will be used — 'keyval'
)keyvalStore
?: (UseStore): Custom idb-keyval
store. Default = undefined
(in that case default idb-keyval
store will be used)Although you can specify custom name for IndexedDB database, and custom name for IndexedDB store, I wouldn't recommend that. Please, read this document from idb-keyval
library.
You don't need to! IndexedDB can store any structured-clonable data.
FAQs
Module for Effector to sync stores with IndexedDB
The npm package @effector-storage/idb-keyval receives a total of 87 weekly downloads. As such, @effector-storage/idb-keyval popularity was classified as not popular.
We found that @effector-storage/idb-keyval demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.