-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to skip spread updates with special token #328
Comments
After internal discussion we came to the conclusion that this would be an inconsistent solution - it misleads people into thinking that it is This problem is easier to solve with native methods, although it may be a slightly more verbose solution sample({
clock: trigger,
fn: (upd) => ({
foo: 0,
...(upd.both ? {bar: 0} : null),
...(upd.baz ? {baz: 0} : null),
}),
target: spread({
foo,
bar,
baz,
})
}) |
But the underlying issue remains opened:
We'll continue to think about this idea, maybe go back to the option suggested above, maybe solve it some other way |
Actually, it looks like someting that sample({
clock: trigger,
target: spread({
first: $first,
second: prepend({
filter: $allowed,
fn: mapData
target: $second
}),
}),
}); It does check all boxes:
|
One of key features of spread is an ability to skip updates for some targets, but it requires object mutation or weird conditionals (it becomes worse when amount of targets grows):
We can add special token SKIP which will mean that this unit will not be triggered:
The text was updated successfully, but these errors were encountered: