New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

redux-thunk-addon

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-thunk-addon

Simplify use of thunk minimizing boilerplate coding

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

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:

  • 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.

  • Insert new addon reducers into reducers collection:
    api: apiReducer(<array of actions string object>),
  • 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.

Keywords

redux

FAQs

Package last updated on 18 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts