use-async-ops middleware to add redux actions that mimic the previous project
const store =
actionTypes object contains the Redux action type strings for Async-Ops actions. The action types are:
actionTypes.OPERATION = 'ASYNC_OPERATION'
actionTypes.COMPLETE = 'ASYNC_COMPLETE'
actionTypes.FAILURE = 'ASYNC_FAILURE'
Optional Reducer and Selectors
use-async-ops-redux ships with a reducer and two selectors that can be used to keep track of the loading and errors states.
A Redux reducer is included that can be optionally added to an app's reducer to keep the store updated with the status about the latest use-async-ops calls. It must be put under the key 'asyncops' which can be imported from the async-ops package as
const rootReducer =
This selector function can be used to determine the loading state of an asynchronous operation.
const mapStateToProps = testOpIsLoading: selectorsstate
This selector function can be used to retrieve error data from an asynchronous operation.
const mapStateToProps = testOpError: selectorsstate