We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm new to the library so many I'm missing something. Given the following top level state:
{ userID: string, photos: { id: string, url: string } }
is there a way to persist photos using MultiFile while having userID in a single file? or do I need to add userID to a top level object?
photos
MultiFile
userID
The text was updated successfully, but these errors were encountered:
Hi yes you can. Although I think userID might need to be an object. But please test and let me know if it works as string:
Here is how you would do:
const appStateProxy = proxyWithPersist({ // must be unique, files/paths will be created with this prefix name: 'appState', initialState: { counter: 0, }, persistStrategies: { userID: PersistStrategy.SingleFile, photos: PersistStrategy.MultiFile, }, version: 0, migrations: {}, // see "Storage Engine" section below getStorage: () => storage, });
Sorry, something went wrong.
yeah, I just ended up putting userID in an object. If I don't it just silently fails :D
Ah thanks for sharing that. I'll document that. I also want to plan to update this lib to support more situations.
No branches or pull requests
I'm new to the library so many I'm missing something. Given the following top level state:
is there a way to persist
photos
usingMultiFile
while havinguserID
in a single file? or do I need to adduserID
to a top level object?The text was updated successfully, but these errors were encountered: