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
storage: undefined if using key option #423
Comments
Can you make a demo? I've using this quite a bit and haven't had any issues. |
I encountered the same issue and here is what it means - the default @@State works but not custom key |
Any updates on this? Looking to use this feature upon app initialization. |
I tried to solve this issue and I think the whole implementation how the key option works is weird. I'm also wondered, that the storage.plugin.ts
and I thought, that the setted pseudo-state:
Implementation:
Implementation 2:
Implementation 3:
Implementation 4:
|
Any update on that ? I am facing the same issue :
then the key |
Here is a slackblitz to reproduce : You can see in the localstorage that app_state is undefined. |
Key is actually the "read" path into the storage object for values to be persisted to localStorage. With the except of
You must have a property in your state model named
The above will store |
@ufoscout should it be closed? The above answer of the
|
@arturovt |
@ufoscout OK, I will made a PR to enhance docs |
Docs PR has been merged. Closing this issue. |
Versions
Repro steps
Initialize the storage plugin with a custom key:
Observed behavior
If the "key" option is passed to the storage plugin, then the value associated with that key in the local storage is undefined.
On the contrary, if the key is not specified, the default one (i.e. @@State) is used and everything works as expected.
Desired behavior
The custom key is used instead of @@State and everything works the same.
The text was updated successfully, but these errors were encountered: