1.1.2 • Published 4 years ago

@baiyezi/react v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react

Baiyezi react tools.

Installation

npm

$ npm install @baiyezi/react

yarn

$ yarn add @baiyezi/react

How to use

makeStore

import { makeStore } from '@baiyezi/react'

const { Provider, Consumer, useStore } = makeStore(0)

const Counter = () => {
  const [count] = useStore()
  return <span>{count}</span>
}

const Button = () => {
  const [, setCount] = useStore()
  return <button onClick={() => setCount(2)}>change count</button>
}

const App = () => {
  return (
    <Provider>
      <Counter />
      <Button />
    </Provider>
  )
}
1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago