MCPcopy Create free account
hub / github.com/Effect-TS/effect / WriteContextImpl

Class WriteContextImpl

packages/effect/src/unstable/reactivity/AtomRegistry.ts:1048–1070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1046}
1047
1048class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected