Skip to content

Instantly share code, notes, and snippets.

vjpr /
Last active Feb 4, 2016 — forked from skevy/gist:8a4ffc3cfdaf5fd68739
Reduce boilerplate in Redux

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with promises, and therefore ES7 async.
View gist:5939a3c95e998ec43c55

Redux is super it may be useful to add some helper utils on top of it to reduce some boilerplate. The goal of Redux is to keep these things in user-land, and so most likely these helpers (or anything like them) wouldn't make it into core.

It's important to note that this is just ONE (and not particularly thoroughly tested) way to accomplish the goal of reducing boilerplate in Redux. It borrows some ideas from Flummox and the way it generates action creator constants.

This will evolve, I'm sure, as time goes on and as Redux's API changes.

Some helper functions to reduce some boilerplate in Redux:

import _ from 'lodash';
vjpr / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
vjpr / backbone-0.9.1.js
Created Feb 26, 2012 — forked from thickey/backbone-0.9.1.js
Externs for Backbone.js and Underscore.js
View backbone-0.9.1.js
* @fileoverview Externs for backbone-0.9.1.js
* built with
* see also:
* via:
* Note: when building via that page, you first need to load in underscrore.js, as that's a dependency.
* also, after running the extern for Backbone, you need to manually run it for: