persist with sessionStorage #2927
Closed
leesei
started this conversation in
3. Feature Ideas
Replies: 2 comments 2 replies
-
It's not hardcoded, that line is just the default value. See docs: https://alpinejs.dev/plugins/persist#custom-storage |
Beta Was this translation helpful? Give feedback.
0 replies
-
I see. But how does |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From persist's source the storage is hardcoded to localStorage.
https://github.com/alpinejs/alpine/blob/main/packages/persist/src/index.js#L4
Supporting sessionStorage is as easy as an if-else switch.
However it seems we cannot pass parameters to plugin constructor, is it right?
Any comments?
Beta Was this translation helpful? Give feedback.
All reactions