Releases: Bloomca/redux-tiles
Releases · Bloomca/redux-tiles
v0.9.1 release
v0.9.0 release
Add getData
function #16 -- sync tile functions now have easier access to current data. So, we can write this code now:
import { createSyncTile } from 'redux-tiles';
export const todosTile = createSyncTile({
type: ['todos', 'list'],
fns: {
add: ({ params, getData }) => {
// instead of:
// const list = selectors.todos.list(getState());
const list = getData();
const newItem = {
...params,
completed: false,
id: createId()
};
return list.concat(newItem);
},
remove: ({ params, getData }) => getData().filter(item => item.id !== params.id)
}
});
v0.8.0
Now dispatching tile functions returns the same interface as a selector, so we can avoid writing cumbersome dispatch
and then selectors
with the same params.
So, this from the past README:
// login user
await dispatch(actions.tiles.user.authRequest(params));
// check the result
const { data: { id }, error } = selectors.tiles.user.authRequest(getState());
We can just write more elegantly now:
const { data: { id }, error } = await dispatch(actions.tiles.user.authRequest(params));
v0.7.1
v0.7.0
v0.7.0-beta.1
Done #15 – added fetched
field to async tile data structure.