track signal dependencies
This commit is contained in:
parent
c0198d419f
commit
b9332ad565
2 changed files with 32 additions and 16 deletions
|
|
@ -51,13 +51,11 @@ export function SignalDigith(props: { signal: Digith.Signal }) {
|
|||
|
||||
// TODO: Not sure about this one. Setting a signal in `setValue` is discouraged.
|
||||
setTimeout(() => setValue(signal.read()), 0);
|
||||
// TODO: Handle cancelation...
|
||||
signal.subscribe((newValue) => {
|
||||
|
||||
const cancel = signal.subscribe((newValue) => {
|
||||
setValue(newValue);
|
||||
});
|
||||
onCleanup(() => {
|
||||
// TODO:
|
||||
});
|
||||
onCleanup(cancel);
|
||||
} catch (e) {
|
||||
// TODO: setErrors... but how? Shouldn't this be independent of `errors`?
|
||||
console.log("Failed to link Signal: ", e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue