This coffeecode
obj
.func1()
.func2()
will result in
obj.func1().func2();
this work find.
But when I type this
obj
.func1 "aaa"
.func2 "bbb"
it will result in
obj.func1("aaa".func2("bbb"));
I must type like this
obj
.func1('aaa')
.func2('bbb')
that result in javsscript
obj.func1('aaa').func2('bbb');
Is there a way to omit parentthese when chain function in coffeescript?
This issue has just been fixed here.
So, for e.g.:
obj
.func1 "aaa"
.func2 "bbb"
will be compiled to
obj.func1("aaa").func2("bbb");
You may need to use the latest version at master branch for now, in npm:
npm install -g http://github.com/jashkenas/coffee-script/tarball/master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With