nbubna / store

A better way to use localStorage and sessionStorage
MIT License
1.91k stars 110 forks source link

Use Web Storage API interface. Fixes #82 #83

Closed cschroeter closed 4 years ago

cschroeter commented 4 years ago

Use global Web Storage API interface so you can pass in window.localStorage without TypeScript warnings

nbubna commented 4 years ago

Looks like you are just removing the Storage type, not using a different one. What am i missing? Sorry, if it's obvious, my brain is in 3 different places today.

cschroeter commented 4 years ago

If no other interface defined in the current context - the global storage interface is used. I've updated the PR to explicitly use the globalThis.Storage :)

nbubna commented 4 years ago

Got it. Thanks!