Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
Async Yield call returning undefined in React

I have an async function for getting token from firebase. But when I fired this function returned undefined. When I consol.log my async function it's return token. After Yield call, returns undefined. I am a new student and I have no idea what is happening. So..If anyone can help me with this problem It's really helped me with my studies. Thank you.❤️

 React.useEffect(() => {
        dispatch(AddUserTokenListener())
    }, [])

async function getUserIDAsync() {
        const idTokenResult = await firebase.auth().currentUser.getIdTokenResult();
        // console.log('User JWT: ', idTokenResult); But this will return token
    }
    
    export function* getUserToken() {
        try {
            const userToken = yield call(getUserIDAsync);
           // console.log(userToken) this will return undefined .
            if (userToken) {
                console.log(userToken)
                yield put(AddUserTokenSuccess(userToken))
            }
        } catch (error) {
            console.log(error)
            yield put(AddUserTokenField(error))
        }
    }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda