Last active
December 11, 2015 16:58
-
-
Save vangie/4630840 to your computer and use it in GitHub Desktop.
coffeescript define function in loop
This file contains hidden or 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
val = (x, ctx, args) => | |
if _.isFunction x | |
x.apply ctx or this, args or [] | |
else | |
x | |
[ | |
openWith | |
replaceWith | |
closeWith | |
repaceHolder | |
openBlockWith | |
closeBlockWith | |
] = ((do(x)=>=>val @model.get(x),@model) for x in [ | |
"openWith" | |
"replaceWith" | |
"closeWith" | |
"repaceHolder" | |
"openBlockWith" | |
"closeBlockWith" | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment