0.1.5 • Published 7 months ago

@vanyamate/sec v0.1.5

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

SEC (Store, Effect, Combine)

Tiny state manager

npm i @vanyamate/sec
import { store, effect, combine } from './index';


const sum = async (a, b) => a + b;

// Create effect
const sumEffect = effect(sum);

// Create stores
const allSums = store(0).on(sumEffect, 'onSuccess', (state, { result }) => state + result);
const lastSum = store(0).on(sumEffect, 'onSuccess', (_, { result }) => result);

// Create combine
const bothSum = combine([ allSums, lastSum ], (...args) => args.reduce((acc, item) => acc + item.get(), 0));
0.1.4

7 months ago

0.1.5

7 months ago

0.1.2

8 months ago

0.1.3

8 months ago

0.1.1

11 months ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago