Skip to content

Releases: developit/unistore

3.0.6

25 May 14:16
Compare
Choose a tag to compare
  • Tiny fix for TypeScript allowing any arguments to be passed to an action.

3.0.5

06 May 01:04
Compare
Choose a tag to compare

3.0.4

29 Jan 14:34
Compare
Choose a tag to compare

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

19 Dec 17:43
Compare
Choose a tag to compare
  • 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

13 Dec 15:11
Compare
Choose a tag to compare

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

3.0.0

12 Dec 13:11
Compare
Choose a tag to compare

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

08 Dec 17:26
Compare
Choose a tag to compare

🐞 Bug Fixes

🔧 Tweaks

🎉 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

07 Dec 03:48
Compare
Choose a tag to compare
  • 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

06 Dec 21:34
Compare
Choose a tag to compare

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

06 Dec 21:32
Compare
Choose a tag to compare
  • support for async actions (see readme)
  • support for state selectors