coffeescript - Chain function call after function definition -


this question has answer here:

how can chain function call after function definition in coffeescript?

equivalent javascript be:

var foo = function () {     // stuff }.bar() 

the way managed is:

foo = `function () {     // stuff }.bar()` 

but hope better solution embedding javascript in (beautiful) coffeescript code

try this:

foo = (-> stuff).bar() 

for example:

square = ((x)-> x*x).bar() 

compiles into:

var square; square = (function(x) {   return x * x; }).bar(); 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -