All Questions
Tagged with thunk async-await
5 questions
0
votes
1
answer
46
views
Wait for API fetch to complete before defining const in Redux
I'm attempting to render a page of Pokemon with their attributes (when selected) in react-redux.
I have a PokemonDetail component
export function pokemonDetail (props) {
const { id } = useParams()
...
0
votes
1
answer
326
views
Uncaught TypeError: Cannot read properties of undefined (reading 'then')?
saveProfile() does not return promise, although the person who has exactly the same code, the same function returns promise
return async (dispatch, getState) => {
const authUserId = getState()...
0
votes
1
answer
148
views
React Native Calling async function and use return in another async function
I'm working with React Native and I have to call 2 Redux thunks before mount (useEffect). The first one is to get the user location. The second one gives me a list of animals near that location.
This ...
0
votes
0
answers
47
views
Async Await API call inside componentDidMount() is suddenly failing/exceeding timeout? React-Native. Redux. Typescript
Async call inside componentDidMount is exceeding timeout and failing.
The api call itself is not using redux, but the data retrieved is.
Is this an instance where I would need to use Redux Thunk?
How ...
7
votes
1
answer
4k
views
What are the benefits of using the co library with promises instead of with thunks?
So I've been reading about the usage of the co library, and the general design pattern I've seen in most blog posts is wrapping functions that have callbacks in thunks. Then using an es6 generator to ...