createnextapp / async-local-storage

AsyncLocalStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app in web browser. It should be used instead of LocalStorage.
MIT License
24 stars 6 forks source link

Feedback #1

Open Stradivario opened 4 years ago

Stradivario commented 4 years ago

Hello there! I am just passing here to ask some questions

  1. Why do you think that wrapping LocalStorage with Promise will give you a better performance ?
  2. Do you know that wrapping Sync function with Async doesn't really give you asyncronious behaviour ?
  3. Have you consider using this library ? https://github.com/localForage/localForage i think you will love it since it is wrapper for LocalStorage, IndexedDb or WebSQL.

Nothing in personal i just check your code and i was curious if you think about these scenarios!

Best Regards, Kristiyan Tachev

vzakharov commented 1 year ago

Yeah, looking at the code, it just defers the execution until the call stack is empty, but it will still block execution afterwards.