Skip to content

Instantly share code, notes, and snippets.

@haltcase
Created November 29, 2017 02:41
Show Gist options
  • Save haltcase/1baffdd2187180c24ff4194c819a8db0 to your computer and use it in GitHub Desktop.
Save haltcase/1baffdd2187180c24ff4194c819a8db0 to your computer and use it in GitHub Desktop.
import { _, it } from 'param.macro'
const plugins = [
{ name: 'foo', isEnabled: () => false },
{ name: 'bar', isEnabled: () => true },
{ name: 'baz', isEnabled: () => false }
]
plugins.filter(it.isEnabled())
// -> [{ name: 'bar', isEnabled: [Function] }]
const hasOwn = _.hasOwnProperty(_)
hasOwn({ rating: 8.6 }, 'rating')
// -> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment