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
-
The way to get users leads to having to write callbacks in every file. Due to the fact that
auth.currentUser
returns a value (not aPromise
like a large proportion of the API. So, my feature request/idea is a separategetUserLoaded
function that would returntrue
only if the user object is loaded (false
is still loading). This would allow the code to be unlittered withonAuthStateChanged
callbacks, and allow it to look much, much cleaner. Another solution is that thecurrentUser
variable 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