-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Session Storage support? #9
Comments
I am considering supporting session storage. I am not sure about it yet.
Can you clarify on that? I'm not sure I understand it correctly.
Is it possible that you share your use case? I am interested in why keeping it in memory doesn't work for you. |
Maybe using memory is the answer for me.
The use case is a landing page with full page sections, on scroll I set a page number from |
Yes, it seems you can do this without session storage. I am closing this issue. If I have misunderstood something please feel free to write back. |
One advantage for sessionStorage over in-memory is, that it survives page reload, and it behaves at tab clone/duplicate as a user would expect it. |
@Taraluktus Are you teammates with @natac13? I am asking because the use case @natac13 described can be done with hash URLs. This way the position of the section will be remembered on page reload and tab duplication. |
No, totally unrelated to him. Not to mention Safari's latest changes to localStorage handling, and of course private browsing. |
@Taraluktus Do you use any kind of library which abstracts the session storage logic? |
No, before useLocalStorageState, we used sessionStorage directly. |
@Taraluktus How did you swap using sessionStorage with using localStorage? Isn't sessionStorage the thing you need? |
They work nearly the same, and also have the same API (but I think you already knew that). |
@Taraluktus Thank you for the time taken to answer my questions. This has been very useful. I will leave the implementation of sessionStorage for now and wait for more feedback. |
Fair enough. |
Hi all, For people interested, I've published a |
Is there any plans to let the user choose between localstorage and session storage. Or even between using the default value over the stored value?
I have a use case that I would only like to use the stored value during the same user session.
The text was updated successfully, but these errors were encountered: