You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect to get the object resolved by the Promise that customerLogin returns.
I want to be able to extract the value from the promise deferFn resolves, then call setData with the resolved response so the component re-renders with the new data e.g.
I need to use deferFn because I only want to run the promise conditionally, promiseFn (which does return the resolved value as expected) executes automatically so wouldn't work here, but I also want to get the data resolved from the deferred promise as well.
The text was updated successfully, but these errors were encountered:
This is actually going to change in the next release, and should resolve your issue. See #83
In a nutshell:
run no longer returns anything
a new promise property is introduced, which properly resolves/rejects as expected
Regardless, you shouldn't need this at all. If you run a deferFn, it's fulfilled value will automatically become the data. You don't need setData to do that.
I'm going to close this because it should be resolved by either relying on run to update data automatically, or by using the newly introduced promise property returned by useAsync.
Uh oh!
There was an error while loading. Please reload this page.
deferFn should resolve the value of it's underlying promise, however it actually always resolves
false
:Logs
false
.I would expect to get the object resolved by the Promise that
customerLogin
returns.I want to be able to extract the value from the promise
deferFn
resolves, then callsetData
with the resolved response so the component re-renders with the new data e.g.I need to use
deferFn
because I only want to run the promise conditionally,promiseFn
(which does return the resolved value as expected) executes automatically so wouldn't work here, but I also want to get the data resolved from the deferred promise as well.The text was updated successfully, but these errors were encountered: