Release Description
- Added data mapper-on-access functionality for additional optimization. This allows to use pre-processed stash value and re-render component only when this processed value changes. For example:
function TodoIndicator() {
const allDone = useData("todos.list.items", (items) => {
return items.every(item => item.status === "completed");
});
// ...
}
The third argument of useData
hook is comparator function that should be used when mapper function returns arrays or objects.