Linked Questions

38 votes
1 answer
23k views

I don't understand the need for something like redux-thunk. From what I understand a thunk is a function which returns a function. The wrapped expressions and the use of middleware appear to me to do ...
1 vote
1 answer
686 views

I'm new to Redux, I've seen a lot of people using some Middleware to handle asynchronous. My question is, I can just do this: fetch(myAPI) .then(res => res.json()) .then(res => { ...
0 votes
0 answers
85 views

In my current code base actions are dispatched from a few stateful components or separated "services" that listen for user or both sensor and real world events. This is a react-native application ...
0 votes
0 answers
41 views

I've searched the answers for this question, but the answers are quite vague, and I still don't get it why we need Redux-Thunk instead of Promise to handle async flows. Please help to take a look at ...
1082 votes
14 answers
534k views

I have an action that updates the notification state of my application. Usually, this notification will be an error or info of some sort. I need to then dispatch another action after 5 seconds that ...
Ilja's user avatar
  • 46.8k
581 votes
11 answers
137k views

There is a lot of talk about the latest kid in redux town right now, redux-saga/redux-saga. It uses generator functions for listening to/dispatching actions. Before I wrap my head around it, I would ...
382 votes
11 answers
230k views

I just got started with ReactJS and am a little stuck on a problem that I have. My application is essentially a list with filters and a button to change the layout. At the moment I'm using three ...
woutr_be's user avatar
  • 9,752
47 votes
2 answers
10k views

I've been struggling for hours to finding a solution to this problem... I am developing a game with an online scoreboard. The player can log in and log out at any time. After finishing a game, the ...
Thai's user avatar
  • 11.5k
28 votes
3 answers
20k views

I read that Redux Thunk is the reliable way to manage asynchronous actions/request. There's nothing much about dispatching actions by other actions. How about dispatching synchronous actions? I am ...
4 votes
3 answers
10k views

I have the following Search Component import React, { Component } from 'react'; import { Field, reduxForm } from 'redux-form'; import { search } from '../../actions/actions' class Search extends ...
Ando's user avatar
  • 1,847
10 votes
3 answers
2k views

Why use Redux Thunk then one can do something like this: ReadableAPI.getCategories().then((categories)=>{ console.log('after getCategories', categories) this.props.dispatch(...
8 votes
1 answer
4k views

I've been using redux for about two months now and have just recently started getting into exploring different ways of dealing with asynchronous behavior such as fetching data. It appears from the ...
2 votes
2 answers
2k views

So I may be asking the wrong question, so please leave comments and I'll adjust. I was told by another developer that when using redux, I should do ALL API calls within actions and create reducers for ...
Shamoon's user avatar
  • 43.9k
6 votes
1 answer
809 views

I was wondering if what I've been doing in my ReactNative/Redux application is wrong. This is how I've been handling async actions. MyComponent.js componentDidMount() { fetch('https://www....
2 votes
2 answers
2k views

Ok, As per my understanding we use middleware in redux for all the async calls now from Apollo documentation we can directly use queries and mutation inside our component. I personally thought that ...

15 30 50 per page
1
2 3 4