Skip to content

Instantly share code, notes, and snippets.

@joaomilho
Created June 3, 2016 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaomilho/6dc439513dac0a6b38de4d5dccb429db to your computer and use it in GitHub Desktop.
Save joaomilho/6dc439513dac0a6b38de4d5dccb429db to your computer and use it in GitHub Desktop.
const load = equals('load')
const unload = complement(load)
const loading = set(lensProp('loading'))
const loadReducer = guard([
[load, loading(true)],
[unload, loading(false)] // runs for all actions except `'load'`
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment