simolus3 / zap

Zap is a fast web framework built on Dart
https://simonbinder.eu/zap/
MIT License
233 stars 12 forks source link

Support mutable `watch()` sources #3

Closed simolus3 closed 2 years ago

simolus3 commented 2 years ago

As of b3ffffeb6fb445e4f0005e11049ecd5298dda636, watch() is supported at any point in a Dart expression, including DOM-inline expressions.

However, we're still missing support for propagating changes to the source of a watch() call, e.g:

Watchable<int> watchable;

$: watchable = someCondition ? watchableA : watchableB;

var test = watch(watchable); // needs to update as `someCondition` changes

With the current implementation, adding support for mutable watch sources would also enable nested watch() calls.