@rnw-community/redux-loadable
v1.8.2
Published
Redux loading state slice
Maintainers
Readme
Redux-Loadable - React native web community
Generic redux loading state, selectors and utils for sending requests and handling loading/error states. Library supports redux-toolkit and other class redux approaches.
Supported loading states:
pristine- nothing has happened to the state sliceloading- loading startedfailed- loading failedsuccess- loading was successful
Utils
Helper reducer functions that will change loading state.
loadingStarted(state: LoadingStateInterface)
loadingFinished(state: LoadingStateInterface)
loadingFailed(state: LoadingStateInterface, error: string)
loadingReset(state: LoadingStateInterface)
LoadingStateInterface
isPristine- flag showing that slice is in initial state and no requests were made.isLoading- flag showing that request is ongoing.error- string, storing last request error message
Examples
Redux-toolkit example
ts-action example
License
This library is licensed under The MIT License.
