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

react-redux-batch

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-redux-batch

Simplified version of batch-helper that's provided by react-redux package

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-redux-batch

Simplified version of batch-helper (https://react-redux.js.org/api/batch#batch) that's provided by react-redux package.

npm install --save react-redux-batch (make sure you've installed react-redux 7.0.1+)

Usage

import {batch} from 'react-redux-batch'

function myThunk() {
  return (dispatch, getState) => {
  
    // Causes 3 re-renders (1 re-render per dispatch)
    dispatch(increment())
    dispatch(increment())
    dispatch(increment())
    
    // Causes 1 re-render
    batch(dispatch, [increment(), increment(), increment()])
    
    // batch provided by react-redux. Also causes 1 re-render
    // batch(() => { dispatch(increment()); dispatch(increment()); dispatch(increment()) })
  }
}

Keywords

react

FAQs

Package last updated on 30 Jan 2021

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