You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I am implementing Supertokens right now for both native and web and I found that it is way harder than it should be because RN doesnt really has a good concept of loaders and in general it almost feels like useEffect is necessary to correctly get the correct states.
I did get a really good solution now that also uses useSyncExternalStore, however the snapshot function there cannot be async (and what I found online was buggy at best). This would be less of an issue if I could inject the storage function however as I already wrote a function that has sync updates and stores asynchronously in the background.
Is this something that would be feasible to implement?
The text was updated successfully, but these errors were encountered:
Instead of relying on calling the session functions which are async I'd like a synchronous way of getting the session information. So I set up a notifier for all events and every time an event occurs, I take a look at the storage. For web its easy as that is just parsing the cookies, but for RN it lies behind an async boundary. The gist of it looks as follows:
I see. We do plan on allowing storage override (like we do for the web SDK), the timeline is unknown though. We welcome PRs.
Also for extra context, getting session information via our SDK functions will always be async cause our SDK also takes case of refreshing the session tokens if needed which requires a network call.
Hey, I am implementing Supertokens right now for both native and web and I found that it is way harder than it should be because RN doesnt really has a good concept of loaders and in general it almost feels like useEffect is necessary to correctly get the correct states.
I did get a really good solution now that also uses useSyncExternalStore, however the snapshot function there cannot be async (and what I found online was buggy at best). This would be less of an issue if I could inject the storage function however as I already wrote a function that has sync updates and stores asynchronously in the background.
Is this something that would be feasible to implement?
The text was updated successfully, but these errors were encountered: