I presume this is a basic mistake, but as my searches made no effect, let's do it here anyway :)
I have a function returning a promise, but it runs so fast (because code is almost empty) that when .then()
is called, it is too late and no event is called.
The reason why it happens is because that's a dummy code (for testing), so, the Promise concept is applied because of a situation where an actual async request is done.
So, is there a way to call the resolve/reject functions even after the function was processed? Or I would have to use lazy promises?
Update: I tried RSVP.defer()
but didn't like its approach as it's not intuitive enough (requires some workaround to set .then()
and .catch()
, etc.