It's more preferable to use lens.js or squirrel.js
Hyperapp#v2 doesn't have slices/namespaces anymore,
so whenever you are working with deeply nested state you have to merge all parents
each time:
const action = (state) => {
return {
...state,
deeply: {
...state.deeply,
nested: {
...state.deeply.nested,
property: true
}
}
}
}
namespace.js - wrapps actions and emulates slices from hyperapp#v1, so now you can
// Each method under namespace will get sliced state specified by path
// Each return value will be shallow-merged into state by specified path
const actions = namespace(['deeply','nested'], {
action(state) => {
return { property: true }
}
})