Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add separate adapters #36

Merged
merged 1 commit into from
Dec 6, 2022
Merged

Add separate adapters #36

merged 1 commit into from
Dec 6, 2022

Conversation

yumauri
Copy link
Owner

@yumauri yumauri commented Dec 6, 2022

Sometimes it is required to persist different stores with different adapters within the same model (file). And to avoid names clashes you should write smth like this:

import { persist as localPersist } from 'effector-storage/local'
import { persist as queryPersist } from 'effector-storage/query'

// ...

localPersist({ store: $session })
queryPersist({ store: $page })

This PR adds exported adapters themselves to use with core persist function:

import { persist } from 'effector-storage'
import { local } from 'effector-storage/local'
import { query } from 'effector-storage/query'

// ...

persist({ adapter: local(), store: $session })
persist({ adapter: query(), store: $page })

@yumauri yumauri merged commit 065b633 into master Dec 6, 2022
@yumauri yumauri deleted the separate_adapters branch December 6, 2022 15:04
@yumauri yumauri added this to the 6.0.0 milestone Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant