Hacker Newsnew | past | comments | ask | show | jobs | submit | miklosbertalan's commentslogin

I think this TodoMVC might be structured the way you described: https://codesandbox.io/s/github/solkimicreb/react-easy-state... It has a separate, clean JS store object. (Note: I am the author of the underlying state management lib.)


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.


Easy State is a minimalistic transparent Proxy based React stage management library with a stronger focus on practicality than code beauty. V6 added sync render batching for common task sources to improve performance.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: