public
Created

  • Download Gist
batman-curry.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10
# Technically partial application, yada, yada, yada...
Batman.Filters.curry = buntUndefined (f, params...) ->
=>
args = Array::slice.call(arguments)
event = args.pop()
args.push(params...)
args.push(event)
f.apply this, args
 
# <a data-event-click="someFunction | curry someValue, 'data'">Yay, context!</a>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.