Idiomatic Redux: Thoughts on Thunks, Sagas, Abstraction, and Reusability

Idiomatic Redux: Thoughts on Thunks, Sagas, Abstraction, and Reusability

The redux-thunk and redux-saga libraries are the most widely-used libraries for “side effects” in Redux. Both provide a place to make AJAX requests, dispatch multiple actions, access the current store state, and run other complex logic. redux-thunk does this by allowing you to pass a function to dispatch(), while redux-saga uses ES6 generators to execute asynchronous logic.

There’s been a lot of recent statements arguing that thunks (and sagas) are bad and should almost never be used. As a result, I’ve seen developers confused and wondering what alternatives they have to implement a given feature.

The concerns being raised are valid, but to balance the discussion, I would argue that thunks are a useful tool in Redux applications, and that developers should not be scared to use thunks in their codebase.

With those thoughts in mind, let’s dig into the discussions and see just what has been said about thunks.

Lots of good stuff in here. I can see a couple of things right away that I have noticed as problematic (duplication of async code, going “dispatch crazy” with chained actions) but struggled to find an obviously better solution.

Nax/lonflow-manifesto

Nax/lonflow-manifesto

The longflow model is an engineering-centric workflow for serious software developers, tired of the “Agile”/”Scrum” bullshit.

There are so many good nuggets in here that match my own experience, but this in particular jumped out at me…

Estimates are to be avoided at all cost. They create needless pressure, competition, and participate in a toxic witch-hunt of who is the less productive.

In the software development world, it is impossible to produce meaningful estimates, let alone precise ones, for anything but nano-tasks.

15 Easy Solutions to Your Data Frame Problems in R

15 Easy Solutions to Your Data Frame Problems in R

R data frames regularly create somewhat of a furor on public forums like Stack Overflow and Reddit. Starting R users often experience problems with this particular data structure and it doesn’t always seem to be straightforward. But does it really need to be so?

Useful tutorial to using data froms in R with an interactive embedded R console to boot!

React Aha Moments

React Aha Moments

Throughout the last few years I’ve taught React in just about every popular medium. Throughout that time I’ve been taking notes on what triggers these “aha” moments, specifically for learning React. About two weeks ago I came across this Reddit thread which had the same idea. So what I want to do in this post is share my collection of these moments while also adding my thoughts on some of the moments shared in that Reddit thread. Hopefully it will help React “click” for you if it hasn’t yet.

Draft-js Pieces

Draft-js Pieces

Draft-js is a highly programmatic rich text editor created by facebook. But it’s not what you might expect. Draft-js is just the underpinnings, leaving everything, and I mean everything, else up to you. When you render an Editor you get a textbox. This is because facebook wanted rich text in a number of different contexts, like all that commenting crap they do. I don’t know.

A useful seven-part series introducing the essential components of Facebook’s Draft.js text editor.