Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!