(value: A)
| 308 | } |
| 309 | |
| 310 | makeRef(value: A) { |
| 311 | const ref = new AtomRefImpl(value) |
| 312 | const notify = (value: A) => { |
| 313 | ref.notify(value) |
| 314 | this.notify(this.value) |
| 315 | } |
| 316 | return new Proxy(ref, { |
| 317 | get(target, p, _receiver) { |
| 318 | if (p === "notify") { |
| 319 | return notify |
| 320 | } |
| 321 | return target[p as keyof AtomRef<A>] |
| 322 | } |
| 323 | }) |
| 324 | } |
| 325 | |
| 326 | push(item: A) { |
| 327 | const ref = this.makeRef(item) |
no outgoing calls
no test coverage detected