-
Notifications
You must be signed in to change notification settings - Fork 9
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
Shorthand syntax for "Auto" reactions #11
Comments
Another option is to add a auto(() => {
// Observed computation here
}).then(result => {
// Unobserved side effects here
}) The bonus being that Naming it And it's similar to |
What would be you thoughts on just passing an optional desired observables array? And eliminating
|
@ryanking1809 I think that introduces unnecessary maintenance burden, and avoiding an extra function isn't worth that cost. For example, if you start using another observable value, you need to also add it to the array argument. If you forget, you'll get potentially confusing bugs. Also, you'd have to repeat yourself quite a bit if you're reaching into a deeply nested structure. Lastly, how would you specify observed properties in the array argument? I think it's all a bit too much trickery. :) |
@aleclarson Yeah that's fair, you've won me over ;) |
"Reactions" are unobserved side effects in response to an observed computation.
The current way to do this:
The proposed way to do this:
The bonus (of course) being that you don't need to import
noto
.The text was updated successfully, but these errors were encountered: