-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Description
I have some code that runs a Promise on repeat.
putOnRotation = (callback, delay) ->
return callback delay
.then (data) ->
console.log(data)
return Promise.delay(delay).then ->
return putOnRotation callback, delay
.catch (error) ->
console.log(error)
return Promise.delay(5000).then ->
return putOnRotation callback, delay
However, I don't like this pyramid pattern, and would prefer to use backcalls.
I've ran into a litany of issues getting them set up, any ideas on how I could remove the indentation of this function using backcalls? Thanks.
Metadata
Metadata
Assignees
Labels
No labels