unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

replace Session Storage and Local Storage drivers with Web Storage driver

Open thecotne opened this issue 2 years ago • 1 comments

Describe the feature

session and locale storage is really same kind of storage so it does not make sense to have two separate drivers for them

see

  • https://developer.mozilla.org/en-US/docs/Web/API/Storage
  • https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API

it's also one interface in typescript for both objects

  • https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts#L21520
  • https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts#L25709
  • https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts#L25758

Additional information

  • [X] Would you be willing to help implement this feature?

thecotne avatar Apr 17 '23 11:04 thecotne

You are right. PR welcome to introduce a single new driver. We can reexport it as local/session storage for ease of use and bw compatibility.

pi0 avatar Apr 17 '23 11:04 pi0