Alistair Lynn

Results 22 issues of Alistair Lynn

There are a couple of other cases where having the signal graph be frozen avoids some hard-to-specify and hard-to-reason-about behaviours, like calling `.unwatch` within a `watched` callback. Here we generalise...

Consider the following code: ```javascript let watcherB const state = new Signal.State(false) const computed = new Signal.Computed(() => { if (state.get()) { watcherB.watch(computed) return 1 } else { return 0...

The algorithm specification for "Method: Signal.Computed.prototype.get" says this in phase 1: > If the current execution context is `notifying` or if this Signal has the state `~computing~`, or if this...

In "Method: Signal.State.prototype.set(newValue)", we have: > 6: For each previously `~watching~` Watcher encountered in that recursive search, then in depth-first order, > i. Set `notifying` to true while calling their...

Consider the following code: ```javascript const a = new Signal.State(0) const b = new Signal.State(1, { [Signal.subtle.watched]: () => { throw new Error("this failed"); }, }) const c = new...

Consider the following code: ```javascript let watcher const a = new Signal.State(0, { [Signal.subtle.watched]: () => { console.log(Signal.subtle.introspectSinks(a)) console.log(Signal.subtle.introspectSources(watcher)) }, }) watcher = new Signal.subtle.Watcher(() => { console.log("notified") }); watcher.watch(a);...

Consider the following code: ```javascript let watcher const a = new Signal.State(0, { [Signal.subtle.watched]: () => { watcher.unwatch(a) }, }) watcher = new Signal.subtle.Watcher(() => { console.log("notified") }); watcher.watch(a); a.set(1);...

The specification for `Signal.subtle.Watcher.prototype.getPending()` specifies: > Return an Array containing the subset of `signals` which are in the state `dirty` or `pending`. This should probably: 1. Read `~dirty~` and `~pending~`,...

In "Method: Signal.subtle.Watcher.prototype.watch(...signals)" we have: > 4. Add this watcher as a sink to each Signal. If this was the first sink, then recurse up to sources to add that...

I think it would be better to be very explicit here rather than relying on implicit reference to the ES `Set`, specifically: that `sources` and `sinks` aren't semantically sets but...