DRY Redux and HTTP API

how to make requests and not get bored to death

@naugtur, meet.js react 01/2016

DRY

Don't Repeat Yourself

DRY

Don't Repeat Yourself

Let's start with Redux

Handwaving explanation

  • One store/state
  • Pure function reducer
  • Actions to drive change
  • React renders

I didn't expect I'd teach you redux in 3 minutes. Here's more

Too serious? Try this

Once upon a time...
a refactoring happened

Livecoding is good only when you cheat

the repo

That library I made:

redux-request-generator
                        
        npm install redux-request-generator
                        
                    

Before you ask...

I'm not the first

There's different ways to get rid of boilerplate around requests.
With their benefits and drawbacks compared to this.

There's also an "official" one. It's showcased in this "real world" example

Alternative ending

I also implemented a version with
founderlab/redux-request-middleware for comparison

Thanks

Contribution/feedback welcome

@naugtur
http://naugtur.pl