Replies: 1 comment 5 replies
-
The main reason I'm against that idea is that all IO operations should be done outside the main thread, due to obvious reasons. Having AsyncStorage synchronous you expose yourself to a jank due to it doing IO work which you have to wait to finish. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
AsyncStorage has always been mirroring LocalStorage from the browser. The limitations of native API, which is all native call have to be async, the storage apis transformed into async version (returning
Promise<string|null>
instead ofstring|null
. And we kind of learned to live our React Native lives this way.With the JSI and synchronous native calls now it seems that that we could actually bring API parity to storage APIs (by implementing exposing sync version of existing AsyncStorage). It could live along with existing AsyncStorage APIs to preserve backwards compatibility, something like
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions