In my experience it is common to pass set from Any down to the components, but the value will be updated on every value change, as long it is creating on every render.
Probably, creating some factory to produce Component with memoized callback is a better way, and it shall not increase the size of this library.
like
const ArrayValue = produce({
speread: value => value,
actions: {
first: value => value.value[0],
last: value => value.value[Math.max(0, value.value.length - 1)],
clear: value => () => value.set([]),
concat: value => proxy(value, 'concat'),
fill: value => proxy(value, 'fill'),
filter: value => proxy(value, 'filter'),
.......
}
})
)
In my experience it is common to pass
set
fromAny
down to the components, but the value will be updated on every value change, as long it is creating on every render.Probably, creating some factory to produce Component with memoized callback is a better way, and it shall not increase the size of this library.
like