4 ms·
I dig what you are saying but after some reflection decided I would rather see kv args. Here is a gist to accomplish that: https://gist.github.com/2625081 https
by shaunxcode 14y ago
I dig what you are saying but after some reflection decided I would rather see kv args. Here is a gist to accomplish that: https://gist.github.com/2625081 https://gist.github.com/2625081 (wish there was simple way to introspect a fn and get its arg names, but saying that a lot of underscore functions have dynamic arities so this only makes sense for specific functions anyway)
$(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.
- jimtla 14y agoVery cool - I like that alot. There's probably a way to programmatically add that for every underscore function, but there's probably not a _good_ way...