astoilkov / use-local-storage-state

React hook that persists data in localStorage
MIT License
1.09k stars 39 forks source link

Support for sessionStorage #65

Closed JanStevens closed 8 months ago

JanStevens commented 8 months ago

Hi,

Very cool neat little hook, would you consider adding support for sessionStorage? I think the API is interchangeable between localStorage and sessionStorage and 99% of the code could be reused.

Thanks

astoilkov commented 8 months ago

Hi! Thanks for the kind words. You can use https://github.com/astoilkov/use-session-storage-state. I maintain that as well.