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

redchain

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redchain

ts based flow-like store

latest
Source
npmnpm
Version
0.5.102
Version published
Weekly downloads
42
Maintainers
1
Weekly downloads
 
Created
Source

redchain Build Status Coverage Status

A library for manipulating state, but in a immutable way

First parameter is the initial state value. Second parameter is the reducer function which has to return the new state, or return the unchanged current state

The reducer will be called by the dispatch trigger, when value changed all listeners will be called.

import redchain from 'redchain';

const store = redchain(0, (previousState, action: number) => previousState + action);

console.log(store.state); // 0

store.dispatch(2);

console.log(store.state); // 2

FAQs

Package last updated on 29 May 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