
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
@effector-storage/react-native-async-storage
Advanced tools
Module for Effector to sync stores with ReactNative AsyncStorage
Adapter to persist store using React Native AsyncStorage.
@effector-storage/react-native-async-storage
has dependency on @react-native-async-storage/async-storage
, so it will auto install it.
But depending on your platform and React Native version, you might want to install AsyncStorage manually, because it might require linking.
So, install AsyncStorage, following documentation for your platform.
Depending on your package manager
# using `pnpm` â
$ pnpm add effector-storage @effector-storage/react-native-async-storage
# using `yarn` â
$ yarn add effector-storage @effector-storage/react-native-async-storage
# using `npm` â
$ npm install --save effector-storage @effector-storage/react-native-async-storage
Import persist
function from '@effector-storage/react-native-async-storage'
module, and it will just work:
import { persist } from '@effector-storage/react-native-async-storage'
// 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 AsyncStorage is asynchronous, hence the name.
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/react-native-async-storage'
persist({ store, ...options }): Subscription
persist({ source, target, ...options }): Subscription
effector-storage
's persist
function.serialize
? ((value: any) => string): Custom serialize function. Default = JSON.stringify
.deserialize
? ((value: string) => any): Custom deserialize function. Default = JSON.parse
.import { adapter } from '@effector-storage/react-native-async-storage'
adapter(options?): StorageAdapter
serialize
? ((value: any) => string): Custom serialize function. Default = JSON.stringify
.deserialize
? ((value: string) => any): Custom deserialize function. Default = JSON.parse
.Options serialize
and deserialize
are got you covered. But make sure, that serialization is stable, meaning, that deserialize(serialize(object))
is equal to object
(or serialize(deserialize(serialize(object))) === serialize(object)
):
import { persist } from '@effector-storage/react-native-async-storage'
const $date = createStore(new Date(), { name: 'date' })
persist({
store: $date,
serialize: (date) => String(date.getTime()),
deserialize: (timestamp) => new Date(Number(timestamp)),
})
FAQs
Module for Effector to sync stores with ReactNative AsyncStorage
We found that @effector-storage/react-native-async-storage 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.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.