New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@crock/redux-helpers

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

@crock/redux-helpers

A set of useful functions to develop with Redux.

0.1.0
latest
Source
npm
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

redux-helpers

A set of useful functions to develop with Redux.

## Installation

npm i @crock/redux-helpers

## Examples

Replace a product in a collection:

import { replace } from '@crock/redux-helpers';

const updateProduct = (state, newProduct) => {
  return replace(
    state.products,
    product => product.label === newProduct.label,
    newProduct
  );
}

// equivalent to:

const updateProduct = (state, newProduct) => {
  const newProducts = state.products.slice(0);
  const index = lodash.findIndex(newProducts, product => product.label === newProduct.label);
  newProducts.splice(index, 1, newProduct);
  return newProducts;
}

API

Check .js.flow or tests files.

Keywords

redux

FAQs

Package last updated on 21 Sep 2016

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