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

@jonstuebe/react-redux-middleware

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jonstuebe/react-redux-middleware

react-redux that runs on setState and the new react context api

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
3
-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

React Redux Middleware

This is two basic middlewares for the all React api driven react-redux

Install

npm

npm i -s @jonstuebe/react-redux-middleware

or yarn

yarn add @jonstuebe/react-redux-middleware

Importing

ES6

import { logger, thunk } from "@jonstuebe/react-redux-middleware";

ES5 (CommonJS)

const { logger, thunk } = require("@jonstuebe/react-redux-middleware");

ES5 (UMD Build)

var thunk = ReactReduxMiddleware.thunk;
var logger = ReactReduxMiddleware.logger;

Usage

thunk

Just like redux, react-redux does not handle async action creators as those can be handled by middleware. Thus thunk.

Writing thunks

const thunk = (a, b) => {
  return dispatch => {
    setTimeout(() => {
      dispatch({
        type: "TEST",
        a,
        b
      });
    }, 3000);
  };
};

logger

By adding the logger you'll get very basic logging in your console.

FAQs

Package last updated on 28 Jan 2018

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