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

iterux

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

iterux

State container, for JavaScript applications, using arrays as sources of sequential updates.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Iterux

State container, for JavaScript applications, using arrays as a source of sequential updates.

Inspired by Redux and Redux Zero.

todo

  • Live example
  • React bindings
  • Iterux Cookbook

Installation

npm

npm install --save iterux

yarn

yarn add iterux

Example usage

import { storeFactory } from 'iterux';

const store = storeFactory({ counter: 0 });

store.registerOnStateChangeCallback(state => console.log(state));

function increment(state) {
    return { counter: state.counter + 1 };
}

function decrement(state) {
    return new Promise(resolve => {
        setTimeout(() => {
            resolve({ counter: state.counter - 1 });
        }, 1000);
    });
}

function alterState() {
    return { altered: 'state' };
}

store.update([ increment ]);
// state becomes: { counter: 1 }

store.update([ increment, increment, decrement, decrement, increment ]); 
// state becomes: { counter: 2 }, { counter: 3 } ..., { counter: 2 }

store.update([ alterState ]); 
// state becomes: { altered: 'state' } - every value returned overwrites the state!

FAQs

Package last updated on 30 Oct 2017

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