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
// TODO (ramfox): because of the way that ApiActionThunk is composed, this is
// the only way to get to the underlying Promise
// it's pretty odd syntax, and it makes me think that perhaps our types
// aren't composed in the most optimal way
// the dream would be to use this pattern: dispatch(someAction()).then(() => dispatch(someOtherAction())).catch((failure) => doSomethingWith(failure))
Because of the way that ApiActionThunks are composed, the only way to get to the underlying promise is to use this syntax:
import {useDispatch} from 'react'
import {someAction} from '/someAction'
const Component: () => {
const dispatch = useDispatch()
someAction()(dispatch)
.then(() => { // thing you want to do when the promise has returned })
This seems off & maybe we aren't surfacing or composing our types in an optimal way.
The text was updated successfully, but these errors were encountered:
// TODO (ramfox): because of the way that
ApiActionThunk
is composed, this is// the only way to get to the underlying
Promise
// it's pretty odd syntax, and it makes me think that perhaps our types
// aren't composed in the most optimal way
// the dream would be to use this pattern:
dispatch(someAction()).then(() => dispatch(someOtherAction())).catch((failure) => doSomethingWith(failure))
Because of the way that
ApiActionThunk
s are composed, the only way to get to the underlying promise is to use this syntax:This seems off & maybe we aren't surfacing or composing our types in an optimal way.
The text was updated successfully, but these errors were encountered: