backset
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Backset

An easy to use React state management tool.

  • Very few APIs.
  • Based on React Hooks and Context.
  • Tracking and eliminate unnecessary re-renders.
  • No redundant template code.
  • Nothing to learn.

Quick start

  1. Run yarn add backset or yarn i backset install it.
  2. Create a store and use it:
import { create } from 'backset'
const { useStores, useUpdates, withContext } = create({ title: 'Hello World' })
 
const Child = () => {
  const updates = useUpdates()
  return <button onClick={() => updates.title('Hello Backset')}>Edit</button>
}
 
const App = () => {
  const { title } = useStores()
  return <div>{title} <Child /></div>
}
 
export default withContext(App)

Edit this example on codesandbox.

Documentation

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i backset

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

32.8 kB

Total Files

14

Last publish

Collaborators

  • echo_unix