3.0.0 (2019-10-02)
Bug Fixes
- "read" method return the same structure as other methods (c0260fc)
Features
- Add
useList
hook and remove old list selector (80c489a)
- Add new "readOne" method to expand/load more information on a item (af2b780)
- Rename "delete" list method to "remove" (39ff862)
BREAKING CHANGES
List.selector
is no longer available. Use new hook to interact with
state and actions.
// define list
const todos = buildList("TODOS", {
read: () => {}
})
// New
// Access all available actions and selector
const {
selector, create, read, readOne, update, delete, clear
} = useList(todos, store.dispatch)
// New
// All previous selector are available throught the new hook
const { items, isLoaded } = selector(store.getState())
- All methoods have the same return format. An object with
result
and
error
keys.
// old
const items = await list.read()
// new
const { result } = await list.read()
- When defining a list, use "remove" instead of "delete".
const todos = buildList("READ_TODOS", {
create: () => ...
read: () => ...
// delete: () => ...
remove: () => ...
})