Skip to content

v2.2.0

Compare
Choose a tag to compare
@ekosz ekosz released this 22 Oct 22:25
· 46 commits to master since this release

This release adds one new action and reverts changes made in v2.1.0:

setPaths

When one wants to set multiple values at the same time, setPaths is the way to do it.

Simple Example

store.dispatch(setPaths(
  { path: 'my.email', value: '[email protected]' },
  { path: 'my.name', value: 'John Smith' },
));

Complex Example

const prefix = ['my'];
const data = {
  email: '[email protected]',
  name: 'John Smith',
};
const pathValues = Object.keys(data).map(field => {
  return { path: prefix.concat(field), value: data[field] };
});

store.dispatch(
  setPaths.apply(this, pathValues)
);

This release also reverts all of the changes in v2.1.0. I misread the documentation and had it all wrong. I'm really sorry about that.