Getting Started
Installation:
npm i --save cs-react
Simple state sample:
import * as React from "react";
import {cs, State} from "cs-react";
const Example = () => cs(
["count", ({}, next) => State({initValue: 0, next})],
({count})=>(
<div>
Count: {count.value}
<button
onClick={()=>count.change((v)=>v+1)}
>+</button>
<button
onClick={()=>count.change((v)=>v-1)}
>-</button>
</div>
),
);
Here is the CodePen demo