Here we're exploring API suggestions that might be handy or help with handling README#precautions:
- Expression with explicit dependencies by @voliva :
const a = timer(0, 1000);
const b = timer(0, 1000);
const c = computed((a, b) => a + b, a, untrack(b)))
This will react to every change and is side-effect safe
It's basically a combineLatest + withLatestFrom + map — most honest way to react to every Observable emission
- Async/await syntax:
const a = timer(0, 1000);
const b = timer(0, 1000);
const c = computed(async () => await $(a) + await $(b))
It might react to every change, and is side-effect safe
- Provide initial value via tracker by @loreanvictor
Trackers might with initial value (default value?)
const a = interval(1000);
const b = timer(500);
const c = computed(() => $(a, 42) + _(b, 'hi!'));
// > 42 hi!
// > 0 0
// > 1 0
// > …
- String tag tracker by @voliva & @loreanvictor:
const a = timer(0, 1000);
const b = tagger`${ a } 🦔`;
// > 0 🦔
// > 1 🦔
// > ...
Alternatives:
-
we can have tagger to be equivalent of a tracker with concatenation
-
string expression might be evaluated
--
Suggested APIs can co-exist with the original one, available via different names.
--
If you have an idea — please, add a comment describing it.
Here we're exploring API suggestions that might be handy or help with handling README#precautions:
This will react to every change and is side-effect safe
It's basically a
combineLatest+withLatestFrom+map— most honest way to react to every Observable emissionIt might react to every change, and is side-effect safe
Trackers might with initial value (default value?)
Alternatives:
we can have tagger to be equivalent of a tracker with concatenation
string expression might be evaluated
--
Suggested APIs can co-exist with the original one, available via different names.
--
If you have an idea — please, add a comment describing it.