Created
August 6, 2013 15:06
-
-
Save mlsteele/6165311 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pre-apply this to an object's method definition to make it return the | |
# context and thus be chainable. | |
# example: | |
# class FOO | |
# addThing: make_chainable (e) -> @stuff.push e | |
make_chainable = (f) -> -> | |
f.apply this, arguments | |
this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment