1.0.4 • Published 5 years ago

redux-thunk-addon v1.0.4

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

redux-thunk-addon

This library simplify the use of redux-thunk minimizing the boilerplate coding.

Installation

npm install --save redux-thunk-addon

Usage

You can use this addon into a project with redux and redux-thunk configured inside.

In this project you can do the following steps:

  1. Create your redux actions using asyncCallAction function:
    asyncCallAction(
       <action string>,
       <promise function used for api call>,
       <arguments passing to api call>,
    );

Inside the actions file export an object with the actions string.

  1. Insert new addon reducers into reducers collection:
    api: apiReducer(<array of actions string object>),
  1. Where you have to calll the api, you can use redux to dispatch the actions created before and you can find the status in the corrisponding reducers (state.api[<action name>]).

Example

In the Example folder you can find a small redux example with this library.

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago