Unistore Versions Save

🌶 350b / 650b state container with component actions for Preact & React

3.0.6

6 years ago
  • Tiny fix for TypeScript allowing any arguments to be passed to an action.

3.0.5

6 years ago
  • Fixed TypeScript definitions (#51, thanks @marvinhagemeister!)
  • Slight size reduction thanks to microbundle update.

3.0.4

6 years ago

This is a bugfix release, in particular addressing the React and Devtools integrations.

  • Fix the React implementation of connect() (#50, thanks @vincentaudebert & everyone)
  • Fix /devtools entry being missing from the published npm package in 3.0.3 (#55, thanks @dioptre)
  • devtools() now returns the store you pass it (#56, thanks @ouzhenkun)
  • Fix devtools ignoring state updates in some cases (#64, thanks @bjrnt)

3.0.3

6 years ago
  • Fix contextTypes for React build (#38)
  • Fix modular react build being missing from package (#37)
  • Fix React setState(null) throwing warning (thanks @srph)
  • Fix actions invoked during componentWillMount() not triggering a re-render (#45, thanks @lilijialiang)
  • Allow spaces in comma-separated selectors (#36, thanks @srph)

3.0.2

6 years ago

This release just fixes the build & package that was released for 3.0.0, which contained some errors.

3.0.0

6 years ago

Unistore now supports React!

  • unistore is now purely the implementation of createStore()
  • unistore/preact is now { Provider, connect } for Preact.
  • unistore/react is { Provider, connect } for React.
  • You can still use unistore/full/preact to access the original single-file module

We've switched to Microbundle, check it out.

2.4.0

6 years ago

🐞 Bug Fixes

  • Fix actions breakage in 2.3.0 (#15/#25 thanks @cfenzo)

🔧 Tweaks

  • Improved TypeScript definition (thanks @DanielRosenwasser & @sammkj)
  • Performance improvements and size reduction
  • Improved docs (thanks @kadmil, @cristianbote, @jakearchibald)

🎉 New Features

  • store.subscribe() now returns an unsubscribe function! (#22, thanks @cristianbote)
  • New store.action(action) API for creating store-bound actions (like connect() does):
let store = createStore()
store.subscribe(console.log)  // log all store updates

// We start with a pure function, as you might pass to connect():
let increment = ({ count }) => ({ count: count + 1 });

// Passing that to createAction() returns a handler like you would get from connect():
let incrementAction = store.createAction(increment)

// Calling the action applies it to the store:
incrementAction()   // logs { count: 1 }

2.3.0

6 years ago
  • Default to an empty state for any falsey values passed to createStore() instead of just undefined.
  • Size & performance optimizations
  • add typings (thanks @sammkj)

2.2.0

6 years ago

New: Built-in support for async functions and actions that return promises!

connect('foo', {
  async getFoo(state) {
    return { foo: await (await fetch('/foo')).json() }
  }
})

2.1.0

6 years ago
  • support for async actions (see readme)
  • support for state selectors