Skip to content


Choose a tag to compare
@aralroca aralroca released this 14 Nov 10:26
· 37 commits to master since this release

What's changed

Breaking changes

  • One this breaking change for this version: Remove confusing reset feature #44

    Reset function is removed. It's not responsibility of the library. In this way:


    • Removing confusion as to what exactly the reset function did. Simplifying and making it easier to understand.
    • Fewer things in memory. Thus it is not necessary to save the store + initialStore. Only the store. This improves performance for applications with very large stores.
    • Tiniest. Supporting reset made it take up more bits.
    • Removing a feature that did not add value to the library, since the same could be done with the setter.
    • More flexibility to the user to reset with the setter where the user wants: last value, last value fetched to an API, initial value...


    • The user will be responsible for controlling the reset. That is, save the value in memory.


      const [value, setValue] = useStore.value()
      const lastValue = useRef(value)
      // After some changes, is possible to reset with:

      Another example:

       const initialStore = { count: 0 }
       export const { getStore } = createStore(initialStore)
       const [,setStore] = getStore()
       export const reset = () => setStore(initialStore)
       import { reset } from './store'
       function ResetStore() {
         return <button onClick={reset}>Reset store</button>

Full Changelog: 0.7.2...0.8.0