@rnw-community/redux-loadable
TypeScript icon, indicating that this package has built-in type declarations

0.67.0 • Public • Published

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.

npm version npm downloads

Supported loading states:

  • pristine - nothing has happened to the state slice
  • loading - loading started
  • failed - loading failed
  • success - 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.

Package Sidebar

Install

npm i @rnw-community/redux-loadable

Weekly Downloads

82

Version

0.67.0

License

MIT

Unpacked Size

29.8 kB

Total Files

67

Last publish

Collaborators

  • vitalyiegorov