Closed ertugrulcetin closed 5 years ago
I haven't looked at http-fx for a while, so I might be forgetting something, but I don't think this library supports a :finally
keyword. Did you read some docs somewhere that talked about this?
@danielcompton It uses ajax.core (cljs-ajax) library under the hood, so I thought :finally
will be supported. Because http-fx creates it's own request-map and hand it to ajax.core.
Ah, of course. I can't see anything that we're doing that would inhibit the :finally
from being called. Have you tried stepping through in a debugger to see if the finally is being hit? Can you share a code sample showing how you're calling it?
Ah, now I think about it, I think that :finally
might only be supported in the simple API, not the ajax-request
one that we use.
Hmm I think if the lib supports core API that would be wonderful. Otherwise we have to provide :finally fn to both on-success
and on-fail
fns.
The lib doesn't support the simple API, and isn't likely to in the near future. For now, providing the :finally
function is probably your best bet, or you could write a simple adapter for the GET
and POST
cljs-ajax functions to turn them into effects. Will close this for now, as there's not much we can do here.
I've added
:finally
keyword to the request map. But it's not getting called.