Gist to add CoffeeScript friendly argument order to Underscore.js
gist.github.com
gist.github.com
$(window).scroll _.throttleKV
func: -> console.log "This print's at most every 500ms"
wait: 500
Nice thing about that is you don't have to rememeber arg order (though you do have to remember the kv names). In coffee though you have less commas, feels nearly smalltalkish.There's probably a way to programmatically add that for every underscore function, but there's probably not a _good_ way...
Spaghetti’s tasty, but belongs on your plate, not your computer.
_.throttle(
->
console.log("Foo")
500
) _.throttle ->
console.log("Foo")
, 500
And it works!Edit: Couldn't find that this has ever been suggested before, so I created a github issue: https://github.com/jashkenas/coffee-script/issues/2307
Thanks