1 comment

[ 2.7 ms ] story [ 9.2 ms ] thread
ReactJS Easy State (https://github.com/solkimicreb/react-easy-state) is a practical state management library with two functions and two accompanying rules.

1. Always wrap your components with view().

2. Always wrap your state store objects with store().

  import React from 'react'
  import { store, view } from 'react-easy-state'

  const counter = store({
    num: 0,
    incr: () => counter.num++
  })
  export default view(() => <button onClick={counter.incr}>{counter.num}</button>)
---

This release adds support for the upcoming React hooks.