Skip to main content
6 votes
Accepted

Managing redux state of mutiple switch components

The general idea here is that we have seven different toggles and we don't want to write the same code seven times in every place. We want to define functions that act on a general notification and ...
Linda Paiste's user avatar
5 votes
Accepted

Redux reducer with a filter

Well, you could use Array.filter to filter the launches. ...
webdeb's user avatar
  • 528
5 votes
Accepted

TODO in React w/ Redux

I'm not exactly sure of your environment (I'm going to assume you're using Node), and with this assumption, I want to address a few things starting with specific things, then more general: Specific ...
Andrew Li's user avatar
  • 261
4 votes

Calling functions if certain strings are in an array

The first thing I would extract is the condition: ...
alexfertel's user avatar
3 votes
Accepted

Flux architecture implementation (vanilla JS)

First of all, Flux is not to be confused with Redux. While both have similarities, the main difference is that Flux allows multiple stores while Redux advises only using one store per app for ...
Joseph's user avatar
  • 25.1k
3 votes
Accepted

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

I'm especially interested in any feedback on my initialization procedures: ... Is that reasonable? As long as your code is dealing with configuration only, it looks good to me overall. (I assume, you ...
Igor Soloydenko's user avatar
3 votes
Accepted

React Redux mutating implementation

Mutation is generally discouraged in Redux (and React in general) because it breaks tooling/libraries that expect x === y to mean that ...
Nathan's user avatar
  • 121
3 votes
Accepted

Calling functions if certain strings are in an array

Define types If you are using a typed language like TypeScript, you should use it correctly. Defining most of the variables as type any does not give you robust ...
Blindman67's user avatar
  • 22.2k
2 votes
Accepted

Counter with increment and decrement buttons

Preface: I haven't worked in the Android ecosystem, so this review is mostly looking at the Kotlin side of things. I've also had minimal exposure to the Redux pattern. Some low hanging fruit that ...
CAD97's user avatar
  • 1,944
2 votes

Photo rating function

There's a few things you can do and different approaches depending on your personal preference. You could: Extract the cases to pure functions Extracting the logic to methods could help with ...
Craig Ayre's user avatar
2 votes

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

You can turn the action types to constants. Have action creators https://redux.js.org/recipes/reducing-boilerplate/ In deletePosts you're passing a cb that's ...
MonteCristo's user avatar
2 votes

Next and Previous navigation

About the HTML As pagination is some form of navigation (i.e., links), you should use a elements instead of button elements. ...
unor's user avatar
  • 2,613
2 votes

Next and Previous navigation

I agree with James that #3 is better because of the separation aspect. I admit that I am a novice as far as React goes, having typically worked with other frameworks like jQuery, PrototypeJS, ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes
Accepted

Next and Previous navigation

Think your worrying yourself about small details here, any advantages of one over the other would be minor at best. I think out of all 3, the last solution would be my preferred one. It's clean from ...
James's user avatar
  • 567
2 votes

Redux Recipe List

I've only started working with React/Redux myself, but here are my thoughts. In my system I am saving the form values to local component state until the form is saved. I have one onChange handler ...
David C's user avatar
  • 121
2 votes
Accepted

Redux: button click potentially fires 3 action for different reducers

I was wondering if when the user clicks “Save” it is better to call a function in the List component that calls “addNew” and “deleteB” and finally “editSave” to only update the state for the “editing” ...
Joseph's user avatar
  • 25.1k
2 votes

Flux architecture implementation (vanilla JS)

Object.assign({}, model) is not deepcopy, it is shalow copy only, you should consider to use Immutablejs by Facebook or write your own library. ...
NTCG's user avatar
  • 21
2 votes
Accepted

Best way to retrieve music metadata from audio files?

It appears music-metadata is the Node.js/desktop flavor of music-metadata-browser (intended for browsers). The author doesn't explain the differences between the two, but maybe the desktop variant ...
Oh My Goodness's user avatar
2 votes

Suppress API call in Redux Saga based on a timer

Disclaimer: I´m not an expert in redux / redux-saga. This post is not directly answering your questions. Rather, it is focused on code design / architecture and what is the most useful approach for ...
Alex Lawrence's user avatar
2 votes

join method inside axios call

Using Array.join is unrelated to usage of async and await. Also note that the time it takes ...
Mohrn's user avatar
  • 370
2 votes

React continuous polling

There are many ways you could implement polling but this one is valid enough for a lot of cases. You could hide your timer off in a redux action somewhere if you were so inclined. It's worth ...
rockingskier's user avatar
2 votes

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

After looking at the implementation, this is not an implementation of global state management. The entire point of things like redux is so you can directly connect components to a global store. In ...
Andrew's user avatar
  • 319
2 votes

Redux/Redux-saga forms architecture optimisations

The reason why you have to search in the way you currently are is because your redux store is so deeply nested. Flatten it and it will make things a lot easier. Have all text inputs, regardless of ...
Andrew's user avatar
  • 319
2 votes

React custom hook

It's a good idea to abstract this away. Otherwise you would end up with a lot of different callbacks. But I think your approach might be improved. First: why do you use different actions instead of ...
jkettmann's user avatar
  • 156
2 votes
Accepted

React custom hook

I agree with the other answer from @jkettmann that you should abstract this. Generally speaking having a long list of if-else conditions usually has a better alternative. That could be a reducer like ...
Quill's user avatar
  • 11.9k
2 votes

interest calculator with React+Redux

Everything's on the front-end You're using HTM to interpret the JSX by putting the JSX through a template literal. It's quite an interesting option, but for a professional project, I think compiling ...
CertainPerformance's user avatar
2 votes
Accepted

React quiz app with Redux, React Router

There are many ways that you can use newer syntaxes to make this cleaner: Function component instead of class component. Replace connect with react-redux hooks. ...
Linda Paiste's user avatar
2 votes
Accepted

Proper way of using redux and props

Redux has a really great style guide which outlines all of the best practices. I can use that to show which rules you are breaking to give you more specific feedback. The good news is that you are ...
Linda Paiste's user avatar
2 votes
Accepted

Filter Options in React

The filtering of options logic can be simplified a bit. Instead of first checking that the product slot array exists and has a truthy length, just allow the array's ...
Drew Reese's user avatar
2 votes
Accepted

Simple memo game project

You're doing great and this code is very clean and well-organized. Keep up the good work! The biggest area for improvement that I see is in the cards.action.js ...
Linda Paiste's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible