Questions tagged [redux-promise]

48 questions
3
votes
2 answers

Recursive Action Call in Reactjs

I have a scenario for implementing refresh auth token. In this scenario, I've implemented a general action for each kind of actions (Post,Get, Delete) and call them with parameters. export function Get(param) { return function (dispatch) { var…
3
votes
2 answers

Add Loading Indicator for React-Redux app with Promise Middleware

I am new to react redux. I want to add a loading text when the user pressed the search button and dismiss the text when data comes back or the action completed. In a normal async function, I can just toggle the isLoading flag before and after the…
ErnieKev
  • 2,831
  • 5
  • 21
  • 35
3
votes
1 answer

How do I add axios to react-redux-universal-hot-example starter kit?

So I picked react-redux-universal-hot-example as a starter kit. I want to make ajax calls to 3rd party API. (I want to use OpenWeatherMap API) I want to use axios and react-promise middleware. The first part installation is easy: npm install --save…
Pet Mor
  • 247
  • 5
  • 11
2
votes
2 answers

React Redux Action Payload returning undefined

I'm trying to get my profile state into redux. the form and action are all working correctly but the action's payload is undefined when it goes to the reducer. Pretty sure it's a rookie mistake but I can't see it for the life of me. I followed…
Keslavi
  • 143
  • 3
  • 14
2
votes
1 answer

Dispatch action in response to another action

I'm setting up redux in my app, and am starting with log in. So far I've got it working great - user logs in using Google, on success my server returns an access token to the web app that is put into the redux store, and can then be used for future…
Graham
  • 4,095
  • 4
  • 29
  • 37
2
votes
2 answers

Keep getting 'dispatch' undefined with redux-promise

I am really new to Redux and its concepts, especially middleware so I do apologise for any stupid errors. In this project of mine, I need to use redux-thunk. I've looked at a few guides and explanations on how to apply them. I then kept receiving an…
Adam Loh
  • 111
  • 1
  • 9
2
votes
0 answers

Start Redux/React Polling after Login

I'm new to Redux, this is a best practice question. I have a server that i'm logging my app into, on a successful Login i'm returned a tokenId and an expiry time for that token. tokenId is attached to subsequent API requests to ensure my sessions is…
2
votes
1 answer

EventBus in React / Redux Applications

I am new to react and wondering what the best way to have decoupled communication in a modular React based application. Actually my issue is a plain old JavaScript abstraction over a restful API that is consumed by a React application. I have a…
2
votes
1 answer

Parse XML in react-redux-promise app

The data source for my app only provides data in XML format. I use axios to get the XML data. It ends up as a string in the data section of the result. I have tried to use xml2js to convert it, but it just fires off a async job and returns, so I…
Endre
  • 175
  • 1
  • 9
1
vote
3 answers

Action does not trigger a reducer in Redux

I'm new to redux and trying to fetch content using the Contentful API. For some reason the action I call does not reach the reducer. I have attached the code I feel is relevant and any contributions would be highly…
Jared Mudd
  • 91
  • 1
  • 4
1
vote
1 answer

Gatsby.js and redux-promise middleware

I'm wondering if anyone knows if redux-promise (or redux-thunk) will work as middleware in the gatsby.js static site generator. I know that gatsby has redux under the hood, so I'm wondering if there are any conflicts when extra/other redux packages…
Matt
  • 811
  • 2
  • 11
  • 20
1
vote
0 answers

Typescript 2.8 conditional types and redux middleware

I found the awesome solution about type-safety redux using typescript's ReturnType feature which is new of version 2.8. actions/types.ts type FunctionType = (...args: any[]) => any; type ActionCreatorsMapObject = { [actionCreator: string]:…
jeyongOh
  • 89
  • 2
  • 7
1
vote
1 answer

Redux-Promise does not prevent rejected promises

Redux-Promise says: If it receives a promise, it will dispatch the resolved value of the promise. It will not dispatch anything if the promise rejects. but when I run the code below and do something intentionally to get the promise rejected in…
farmcommand2
  • 1,418
  • 1
  • 13
  • 18
1
vote
1 answer

Accessing elements of reducer payload that is an object

This is a basic weather app that I'm doing to learn Redux. The API does not provide the city name that one searches for, so I must pass it via Redux. I have the following container: import React, { Component } from "react"; import { connect } from…
Mike Holzbach
  • 45
  • 1
  • 2
  • 8
1
vote
1 answer

Redux loses state when navigating to another page using react-router 'history.push'

(as you can see my reputation is not very high :) and I understand that if you don't like my question it is going to be my last one, therefore I am going to write it as good as I can :) The problem I am facing is a similar to: Redux loses state when…
Yossi
  • 5,577
  • 7
  • 41
  • 76