(f: (a: B) => void)
| 211 | return this.transform(this.parent.value) |
| 212 | } |
| 213 | subscribe(f: (a: B) => void): () => void { |
| 214 | let previous = this.transform(this.parent.value) |
| 215 | return this.parent.subscribe((a) => { |
| 216 | const next = this.transform(a) |
| 217 | if (Equal.equals(next, previous)) { |
| 218 | return |
| 219 | } |
| 220 | previous = next |
| 221 | f(next) |
| 222 | }) |
| 223 | } |
| 224 | map<C>(f: (a: B) => C): ReadonlyRef<C> { |
| 225 | return new MapRefImpl(this, f) |
| 226 | } |