Skip to content

Instantly share code, notes, and snippets.

@christianalfoni
Last active July 2, 2016 12:04
Show Gist options
  • Save christianalfoni/1ab82be5d4d7c58805a0a09acf032695 to your computer and use it in GitHub Desktop.
Save christianalfoni/1ab82be5d4d7c58805a0a09acf032695 to your computer and use it in GitHub Desktop.
/*
# OPERATORS
copy
toggle
set
unset
when
throttle
debounce
filter
delay
*/
// SET
[
set('state:foo.bar', 'foo')
]
// COPY
[
copy('input:foo', `state:${CONSTANT}`)
]
// WHEN
[
when('input:foo'), {
accepted: [],
rejected: []
},
when('state:user.role', {
'admin': 0,
'superuser': 1
}), {
admin: [],
superuser: []
}
]
// THROTTLE
[
throttle(200), {
accepted: [],
rejected: []
},
/*
...throttle(200, [
])
*/
]
// DEBOUNCE
[
debounce(200), {
accepted: [],
rejected: []
},
/*
...debounce(200, [
])
*/
]
// FILTER
[
filter('input:foo', filterFunc), {
accepted: [],
rejected: []
},
/*
...filter('input:foo', filterFync, [
])
*/
]
// DELAY
[
delay(200)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment