.bind function with CoffeeScript
.bind function with CoffeeScript
当我尝试转换以下代码片段时。。。
result.pause = function() {
cachedValue = this();
isPaused(true);
}.bind(result);
使用http://js2coffee.org/它返回
result.pause = ->
cachedValue = this()
isPaused true
.bind(result)
但是,当您尝试编译该代码时,会返回错误"
在这种情况下,使用CoffeeScript使用.bind函数的正确方法是什么?
result.pause = (->
cachedValue = this()
isPaused true)
.bind(result)
相关文章:
- Fighting with FRP
- issue with FB.Event.subscribe
- geolocation-marker.js conflict with markerclusterer.js
- Angular 2.0 with JavaScript or TypeScript?
- 为什么不推荐使用“with”?是否有更好或其他方法可以“下降”到对象的命名空间
- WebComponentsJS with IE10
- 指令的模板必须只有一个根元素:With restrict E&替换true
- timeago.js with datatable and PHP
- Ajax and Json with Rails
- errors with Javascript try catch
- how to split a string with ','
- Understanding Javascript scope with "var that = this&qu
- Architecture for CPU intensive tasks with NodeJS & Socke
- How to declare a Map containing certain properties with flow
- 设置'这'在React with Inverse Data Flow中
- Unit-testing multiple use cases with Karma & Mocha.js
- Jquery Validate with Coffeescript
- Coffeescript Promise with Jquery Post
- preventDefault在使用CoffeeScript with Rails4提交时未处理else条件
- .bind function with CoffeeScript