easy-state-maneger-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Simple state maneger

Install

npm i easy-state-maneger-react

Example for React

import { createEasyStore } from "easy-state-maneger-react";

const initState = {
    count: 0
}
export const {useSelector, updateStore} = createEasyStore(initState);

export function Action(){
    updateStore((state)=>{
        state.count++;
    });
}
import { Action, useSelector } from "./state";

export function App() {
    const count = useSelector((s)=>s.count);

    return (
        <div className="App">
            <button onClick={Action}>{count}</button>
        </div>
    );
}

Package Sidebar

Install

npm i easy-state-maneger-react

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.45 kB

Total Files

4

Last publish

Collaborators

  • senails