Questions tagged [redux]

Redux is a predictable state container for JavaScript applications based on the Flux design pattern.

Filter by
Sorted by
Tagged with
1
vote
0answers
15 views

Syncing Redux state with the URI in 2020

I have a React/Redux/Router/Reselect app in which I am syncing some parts of the redux state with the URL. As an interim, hacky measure (I've only been learning how to write wepapps for about 6 months ...
1
vote
0answers
13 views

React App with Redux

Decided to give ReactJS + Redux + Typescript a try this weekend. Going to include the code first and then summerize a few questions that came into my mind during development. Also posting here to get ...
1
vote
0answers
12 views

Custom Global Store using React.js context and hooks

I wanted to use an external global state to a React.js application with a redux-like sort of pattern (with reducers, actions, etc). However, I don't want to use redux itself, as it's just a small ...
5
votes
0answers
195 views

React Context & Hooks custom Vuex like store

I've been experimenting with Hooks lately and looking more into how can I replace Redux with useContext and useReduer. For me, ...
1
vote
2answers
54 views

React custom hook

I have an input hook that is reusable in other input fields. These input fields have onChange functions that are dispatched by redux. My question is, is the following code considered a react hook? ...
0
votes
0answers
22 views

Using redux for a couple of components only

I have a mobile app built using react native, the app's core functionality is to process payments. It has some screens to view transactions, merchants and some other stuff. When I started building the ...
2
votes
0answers
256 views

Redux pagination transducer

Motivation In my web app (React, Redux, TypeScript) we have a common need to write paginated API calls, with various UI interactions (infinite scroll, prefetch pages in the background, or manual page ...
1
vote
0answers
22 views

Redux Reselect Selector [closed]

I've got this really convoluted reselect selector. It's going a few levels deep and setting a couple of attributes. What's a good way to split this up to make it more readable? Ideally in a "redux" ...
2
votes
0answers
52 views

Reduce repetition in these Redux CRUD actions

My React application manages some entities. I'm using Redux (with redux-thunk) to manage the application state. I've created a RESTClient based on Axios: ...
2
votes
1answer
40 views

React Redux mutating implementation

I am making a Trello clone just for personal project and I wonder if my implementation on mutating the state is good. My state is basically shaped like this: ...
2
votes
1answer
36 views

Redux/Redux-saga forms architecture optimisations

I am designing this nice form handling in React/Redux/Saga and I am quite afraid it might not be optimised. So I decided to ask you what you think :) First of all, I won't get into details how I ...
2
votes
1answer
87 views

Simpler state manament alternative to Redux, MobX, Context API, etc

I got frustrated with the jargon and created an alternative state management solution. Its up at https://github.com/smakazmi/react-soliit. It goes something like this ...
1
vote
1answer
582 views

React continuous polling

I have a Notifications component in my React app, which continuously polls the server for new notifications. The app uses Redux for storing notifications. When a new notification is received, it is ...
1
vote
1answer
37 views

join method inside axios call

I am doing a join in the axios call. since doing two different api calls. for performance is this the good way. or do I need to use async await and then do join. providing code snippet below ...
1
vote
0answers
82 views

React-Router, render multiple components

This works but it doesn't really seem ideal. Is there a better way to write this using react-router? Initialization and pagination are just React containers holding logic. ...
3
votes
1answer
124 views

multiple api calls through promise

update1: - I need to make two different api calls. - from the result of first api call I am getting id in the variable firstAPIid, https://reqres.in/api/users?page=2 - I need to pass this id ...
1
vote
0answers
54 views

Allows the use of Redux to manage the state of a grid with the Kendo React Library

I wanted to use Redux to manage the state of my KendoUI components such as the grid. The online examples from Telerik do not seem to contain clear information on how to do this, so, I started to ...
1
vote
1answer
66 views

Suppress API call in Redux Saga based on a timer

I have an API that provides data that is updated on an infrequent schedule, about once every 2½ minutes on average. Assuming that it's okay to fetch only as often as every 2½ minutes or less often, I'...
1
vote
0answers
21 views

Dynamically build tagged union and helper that allows its instantiation and calling of its static methods

I am working on a typescript react/redux app that provides a visual interface for the code editor with a predefined set of instructions. It's basically a tree structure of objects that I call ...
1
vote
0answers
764 views

React Hooks conditional in useEffect

I'm starting using hooks, and I have a specific scenario that I'm thinking useEffectis appropriate for. Essentially what I'm doing is: I have some ...
4
votes
2answers
1k views

Best way to retrieve music metadata from audio files?

I am using the music metadata-browser npm package to retrieve audio metadata from files. This library is being used in an Electron and React desktop app. To get the metadata of audio files, (and add ...
0
votes
1answer
44 views

Optimizing NGRX reducer

I am trying to optimize my reducer code, preferably into one-liner with high-order-functions. Reducer should return new array with names of groups, with new number. Below are correct inputs and ...
0
votes
1answer
53 views

Returning a new object reference when mutation happens

i attempted to create a way (not sure if already implemented by someone) by which when i update a property of an object. it returns a new reference of the object with the new value. i have a usecase ...
1
vote
1answer
52 views

Redux: button click potentially fires 3 action for different reducers

I’m using Redux and thunk, I have a list component ...
1
vote
1answer
30 views

Summary page with react-redux: container or presentational component

I'm building a Summary page for merchant activity in a marketplace with react and redux. The application has already a structure where there is a "MerchantContianer" ...
1
vote
0answers
28 views

In React/Redux, fetch a list from a server and create a randomized subset with lifecycle methods

This is my first React/Redux project. I'm pulling down a list of Google Fonts, then displaying a list of 3 randomly selected ones. I want the list of random fonts to be populated automatically after ...
0
votes
0answers
70 views

Fibonacci-Counter implemented with React-Redux

After learning the basics of React-Redux I've made an app to familiarize myself more with the concepts. It's a counter which counts-up the Fibonacci-Number. Here's my code: ...
2
votes
1answer
40 views

Redux actions inside a container for a calculator

I used to import all the actions in the container's argument which looks messy (I put a comment below where I do it in that way). I want to know if there is a better approach when using actions with ...
0
votes
1answer
866 views

Playing cards with ReactJS

I came across problem 54 on projecteuler.net and decided to give it a go using ReactJS. I have had Angular experience prior to this. I wrote a couple of fully tested components. I think that they only ...
1
vote
0answers
13 views

Dispatches an event to detect a camera - Once the camera has initialised resolve a promise to say the camera is detected

I am relatively new to redux - I wanted to keep the actions in the same detectJsCamera function which is why I decided to resolve a promise to detectCamera - hence the set timeout. I am not sure how ...
3
votes
0answers
44 views

Status dispatching of my redux-thunk async action (post request)

I'm trying to dispatch to my reducers the current status of my request. So far I'm wondering how refined the status publishing of my thunk action. I feel like my code is very verbose and I wonder ...
5
votes
2answers
538 views

Flux architecture implementation (vanilla JS)

I'm trying to better understand flux-style architecture, so I wrote this snippet to clarify how a simple flux system can be designed. I was wondering if my implementation is valid, or if I've missed ...
3
votes
2answers
205 views

Redux Recipe List

I made a simple React + Redux app which allows you to add and remove recipes to a list. Here are the user stories the app fulfills: User Story: I can create recipes that have names and ingredients....
2
votes
1answer
331 views

Simple blog using react redux react-router

I've implemented the logic of my app, but I'm not sure whether it appropriate way or not. Task: create a react app using redux, react-router v4 which has a page with a form for adding new post and ...
0
votes
1answer
431 views

TODO in React w/ Redux

Please critique my TODO App in React w/ Redux: ...
3
votes
1answer
364 views

Angular + Redux app organization and initialization: transfer from a PHP-driven website

Our system is largely a PHP-driven system. We're not doing the full split back/front-end. Most pages are plain HTML served directly by PHP. However, a few parts of the system are very dynamic and ...
1
vote
0answers
130 views

React Redux default playground

Lately I am answering more and more questions regarding ReactJS & Redux on SO and I created a basic playground that should help me answer questions faster. The goal of the playground is to have ...
1
vote
1answer
53 views

DRYing out my action creators

I've created a private function called _successResponse to handle successful responses from my promise. The challenge was passing the dispatch function to the <...
1
vote
1answer
38 views

Logging observable values while extending service

I'm trying to extend a service function which returns an Observable<T>. The idea is to extend the function so I can add logging functionality whenever the ...
3
votes
1answer
63 views

Photo rating function

I want to create a photo rating function. If I click thumbs up then votes increase, and if I click thumbs down then votes decrease. ...
1
vote
0answers
165 views

Asynchronous counter

I built a simple counter in React. I'm using Redux for state management and Redux-Saga for async calls. I'm looking for feedback on directory structure, coding style and pretty much everything else. ...
1
vote
0answers
625 views

React, Redux and SignalR connection dependent on global jQuery

I'm writing a react/redux application and I'm on a stage when I need to connect it with backend made with .net using a signalR socket connection. At the moment I've established interconnection ...
3
votes
1answer
307 views

A CRUD blog with a basic auth system made with the MERN stack

I would like some feedback on things that maybe could've been written a lot better. I used redux for handling state. GitHub repo Demo This blog project is meant to create, read, update, and delete ...
2
votes
3answers
605 views

Next and Previous navigation

I'm sorry, maybe this question is really stupid but I have really been thinking a lot about it recently, thinking of which type of <prev | next> web ...
1
vote
0answers
40 views

Rendering two logos in a React search component

Using React.Perf I found that there are few bottlenecks in the render code of one component from the big React app (look at the numbers 1 and 2 in the code below). For sake of simplicity I stripped ...
4
votes
0answers
197 views

React.js defaultMemoize as container

this is the code I wrote ...
3
votes
2answers
228 views

Rewriting Crime Map - React Component with Redux

I've been working on a crime map demo - and I am keen to learn more about how to rewrite this application to use redux. What is the best approach, why - what is wrong with the way its currently ...
2
votes
0answers
105 views

Update state to render data in a form

I have a form which needs to display value in its input field initially. There is no post API used, only get and put. I could show the data initially by updating the state from the ...
6
votes
1answer
1k views

Generic dataloader for redux-thunk using axios

I am developing an application where there are lots of async actions. I wanted to go with redux-saga but most have insisted to continue with redux-thunk. In redux-thunk, inside each action we have to ...
2
votes
0answers
583 views

An Mp3 player using React and Redux and the HTML5 web audio API

I built a simple MP3 player with React and now I would like to incorporate Redux to the app as it is getting larger and I feel Redux will help it to be more organized and efficient. I was wondering ...