Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class kdApi
@tries=0
constructor:->
@apicall(1)
returned:(r)->
if r isnt 10
setTimeout () =>
@apicall r
,1000
else
@finished r
finished:(r)->
console.log "finished with "+r
apicall:(i)->
@tries++
console.log "called with "+i+" @tries:"+@tries
@returned Math.floor Math.random()*11
new kdApi()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.