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

chronicle

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chronicle

Tiny observable & high-performance state management

2.0.0-alpha.1
alpha
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

chronicle

Tiny observable & high-performance state management with RxJS as first-class citizen.

NPM version Build Status

Installation

$ npm i chronicle --save

Usage

import { createStore } from 'chronicle';

const counter = (state = 0, action) => {
  switch (action.type) {
    case 'INCREMENT':
      return state + 1
    case 'DECREMENT':
      return state - 1
    default:
      return state
  }
}

const epic = (action$, store) =>
  action$
    .filter(action => action.type === 'DECREMENT')
    .map(() => ({ type: 'INCREMENT' }));

const store = createStore(counter, null, epic);

store.dispatch({ type: 'DECREMENT' });

// Will output 1 instead of -1
console.log(store.getState());

Credits

Thanks to Redux Observable for the initial inspiration and Forbes Lindesay for donating the chronicle npm name.

License

MIT © Robin van der Vleuten

Keywords

flux

FAQs

Package last updated on 21 Nov 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