kovenant icon indicating copy to clipboard operation
kovenant copied to clipboard

Question about chaining long processes.

Open scottandrew opened this issue 6 years ago • 1 comments

I was trying to chain long processes but it wasn't working. All the long processes were returning deferredPromises.

I thought this was working not too long ago but the update to AndroidStudio 3.1 seems to have broken something. I was seeing pending promises fall through. It was something like.

renewToken() then { getData() } successUI { broadcast update }

The broad cast update was happening while getData was pending. I have worked around by doing:

all(renewToken(), getData()) successUI { }

It appears though that the then is not working at all. Its just falling through. I had another case where this was falling through when trying to log out then show login screen when logout was complete.

scottandrew avatar Mar 28 '18 06:03 scottandrew

Figured this out. I used bind and that did what I wanted to do. I can do things like

refreshToken bind { getData() } success { broadcast update }

scottandrew avatar Mar 28 '18 16:03 scottandrew