Skip to content

Releases: ncking/react-simple-store

2.0.2

13 May 12:24
Compare
Choose a tag to compare

Fixed typings for /redux & /utils submodules

2.0.0

14 Jun 08:12
Compare
Choose a tag to compare

Breaking Changes

The createStore function argument list has changed to
the parameter object pattern.
It has the same arguments, just wrapped in an object.

Why
The argument list will be expanding, with flags & functions for new features.
Making the change now, will future proof v2 code, when these changes are implemented.

Change

- export const createStore = (
-   actions: ActionsCreator,
-   initialState: State = {}
- ) => {
+ export const createStore: CreateStoreApi = ({
+   actions = () => ({}),
+   state: initialState = {},
+ } = {}) => {

Migrating to v2

You just need to change the arguments list on calls to createStore(),
to be a single object

// from
const myStore = createStore(actions, state)
// to
const myStore = createStore({actions, state})

1.0.4

30 May 10:10
Compare
Choose a tag to compare
bump version