actus-react

0.1.0-alpha.0 • Public • Published

actus-react

React bindings for actus

npm version

Included and preconfigured plugins

Install

npm install actus-react

Examples

Usage

First create a store

// store.js

import { createStore } from "actus-react";

export const { actions, useSelector } = createStore({
  state: {
    number: 0,
  },
});

Then use actions and useSelector() in your components, that's it!

// App.js

import { actions, useSelector } from "./store.js";

export default function App() {
  const number = useSelector((state) => state.number);

  return (
    <>
      <h1>{number}</h1>
      <button onClick={actions.number.increment}>+</button>
      <button onClick={actions.number.decrement}>-</button>
    </>
  );
}

Readme

Keywords

Package Sidebar

Install

npm i actus-react

Weekly Downloads

0

Version

0.1.0-alpha.0

License

MIT

Unpacked Size

5.91 kB

Total Files

4

Last publish

Collaborators

  • evgenyorekhov