DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

JaredHarbison
JaredHarbison

Posted on

DRAGnet Reducer

Rails + React + Redux - Pt 11


The queens_reducer.js was the first reducer I wrote for DRAGnet. It was a natural choice as the simplest.


Let's get started!


For UPDATE_QUEEN I defined idx as the id for the queen being updated by the user. In the case of UPDATE_QUEEN, the return is the data for the updated queen spliced from the complete array of drag_queens.


That's all folks!

Top comments (0)

An Animated Guide to Node.js Event Lop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.