Sunday, November 29, 2020

Show HN: Luciex – A small simplistic state management library

Luciex

Introduction

Luciex is a simplistic state management library.

Luciex has a simple chainable interface making it as easy as possible to get right in.

Installation

$ npm install luciex
# Or with yarn
$ yarn add luciex

Try It Out

You can create a simple store (or as we call it, an atom) for a counter app in only a couple lines.

import { Atom } from 'luciex';

const counterAtom = new Atom(0);

const increase = (count: number) => count + 1;
const decrease = (count: number) => count - 1;

await counterAtom.dispatch(increase);
await counterAtom.dispatch(decrease);


from Hacker News https://ift.tt/3mjOZII

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.