Skip to content

Instantly share code, notes, and snippets.

class SomeAjaxCallback
constructor: (@value) ->
throw "Bad value" unless value?
setTimeout @process, 5000
# setTimeout doesn't give us a "new context"
# so we'd get our "global context" : window.
# let's avoid that using the fat arrow.
process: =>
throw "Wrong context" unless @value?