According to the docs, "Without middleware, Redux store only supports synchronous data flow". I don't understand why this is the case. Why can't the container component call the async API, and then dispatch the actions?   For exampl...
I am trying to chain dispatches with redux thunk  function simple_action(){   return {type: "SIMPLE_ACTION"} }  export function async_action(){   return function(dispatch, getState){     return dispatch(simple_action).then(()=>{...});   }...
When writing redux-thunk functions, known as thunks there is allot of boilerplate that could be easily abstracted away. For example in most of our async API calls we are doing the following, without any side-effects:  export const LOGIN_REQUEST = ...
I've been working with React and Redux for about 3 years. Also I use redux-thunk for asynchronous stuff.  And I love them a lot, but recently I noticed that almost all ducks in my project are using the same structure of actions, reducers, selecto...
I just started learning flowtype and i need some help to understand two things that aren't clear on my mind.   Using https://github.com/reactjs/redux/blob/master/examples/todos-flow as an example, i wonder how control over types can work without...
Question:  I use redux-thunk and I want to receive posts. To receive posts I need to get users. So I have doubts about my thunk, Is it right to get all the data in one thunk, if not how to split it into two thunks?  Thunk example:  export default gro...
Some action have async function like fetch. But, i don't want to use middle ware like redux-thunk or redux-saga.  So, i hesitate to use this code.  /* actions */  ...  export const fetchRequest = ({category, query, dispatch}) => ({     type: a...
I have an app that fetches some user info on render. So when the app first boots up it fetches the data with the use of getUserInformation() function. User doesn't need to manually log in, the app is inside the company's internal network....
I have a RN component that fires fetchPosts in componentDidMount.  The fetch posts fires immediately, but doesn't complete until I click on the IOS simulator. If I don't click on the simulator, I'll never see the receivePosts action no ma...
I'm using redux thunk to fetch some data in an action  function handleErrors(response) {     console.log(response)     if (!response.ok) {         throw Error(response.statusText);     }     return response; }  export const something = (var) =>...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.