| 1046 | } |
| 1047 | |
| 1048 | class WriteContextImpl<A> implements Atom.WriteContext<A> { |
| 1049 | constructor( |
| 1050 | registry: RegistryImpl, |
| 1051 | node: NodeImpl<A> |
| 1052 | ) { |
| 1053 | this.registry = registry |
| 1054 | this.node = node |
| 1055 | } |
| 1056 | readonly registry: RegistryImpl |
| 1057 | readonly node: NodeImpl<A> |
| 1058 | get<A>(atom: Atom.Atom<A>): A { |
| 1059 | return this.registry.get(atom) |
| 1060 | } |
| 1061 | set<R, W>(atom: Atom.Writable<R, W>, value: W) { |
| 1062 | return this.registry.set(atom, value) |
| 1063 | } |
| 1064 | setSelf(value: any) { |
| 1065 | return this.node.setValue(value) |
| 1066 | } |
| 1067 | refreshSelf() { |
| 1068 | return this.node.invalidate() |
| 1069 | } |
| 1070 | } |
| 1071 | |
| 1072 | // ----------------------------------------------------------------------------- |
| 1073 | // batching |
nothing calls this directly
no outgoing calls
no test coverage detected