Reputation: 36354
I am struggling to re-produce a function like this in coffeescript could someone help me out a little.
// Listen to message from child window
eventer(messageEvent,function(e) {
console.log('parent received message!: ',e.data);
},false);
Upvotes: 0
Views: 89
Reputation: 30660
# Listen to message from child window
eventer messageEvent, (e) ->
console.log "parent received message!: #{e.data}"
, false
Verified with coffeescript.org's sandbox CoffeeScript compiler.
Upvotes: 0
Reputation: 13649
Your code translates to this equivalent one in CoffeeScript:
# Listen to message from child window
eventer messageEvent, ((e) ->
console.log "parent received message!: ", e.data
), false
You can always use this tool in the future if you need help with the CoffeeScript equivalence of a JavaScript code:
Upvotes: 2