Ability to use auth.currentUser (or other user state mechanism) rather than onAuthStateChanged
#6332
Uncodeable864
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The way to get users leads to having to write callbacks in every file. Due to the fact that
auth.currentUserreturns a value (not aPromiselike a large proportion of the API. So, my feature request/idea is a separategetUserLoadedfunction that would returntrueonly if the user object is loaded (falseis still loading). This would allow the code to be unlittered withonAuthStateChangedcallbacks, and allow it to look much, much cleaner. Another solution is that thecurrentUservariable could have a type ofUser | 1 | undefined. The variable's value would start off at1, and continue from there.Beta Was this translation helpful? Give feedback.
All reactions