use-one

A simple state management library in react app. State sharing and persist never been so easy :)

MIT License

Downloads
261
Stars
10
Committers
4
use-one - 0.8.1

Published by suhaotian about 4 years ago

  • Add .replaceState method and warn .setState
  • Add .forceUpdate method
  • Add .getUpdateCount method, we can know how many times update in our state now
  • Add boilerplate code generator support: use-one-templates
use-one - Less is more

Published by suhaotian about 4 years ago

  • No more on/off with every render
  • Optional generic type for createOne
use-one -

Published by suhaotian about 4 years ago

  • fix bug with type

Detail: before if we const [useCount, counStore] = createOne(0), then if we use counStore.getState()+1, will get type error.

image

use-one - 0.6.0

Published by suhaotian about 4 years ago

  • fix type bug
use-one - 0.5.0

Published by suhaotian about 4 years ago

Change:

  • No need add generic type with createOne<[GenericType]>, inspired by React's useState
  • Internal: no subscribe and unsubscribe with every render!
use-one - 0.4

Published by suhaotian about 4 years ago

use-one - Add UMD build

Published by suhaotian about 4 years ago

jsdeliver

<script src="https://unpkg.com/[email protected]/umd/eventemitter3.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/useone.umd.production.min.js"></script>

Browser Namespace: UseOne.createOne

use-one - Born

Published by suhaotian about 4 years ago

First version

Enjoy :)