Socket
Socket
Sign inDemoInstall

actus-react

Package Overview
Dependencies
13
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    actus-react

React bindings for actus


Version published
Maintainers
1
Created

Readme

Source

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>
    </>
  );
}

Keywords

FAQs

Last updated on 30 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc