MCPcopy Create free account
hub / github.com/TanStack/query / registerOptionEffect

Function registerOptionEffect

packages/angular-query-devtools/src/with-devtools.ts:133–143  ·  view source on GitHub ↗
(
          option: T | Signal<T | undefined> | undefined,
          update: (value: T | undefined) => void,
        )

Source from the content-addressed store, hash-verified

131 })
132
133 const registerOptionEffect = <T>(
134 option: T | Signal<T | undefined> | undefined,
135 update: (value: T | undefined) => void,
136 ) => {
137 if (!isSignal(option)) return
138 afterRenderEffect({
139 write: () => {
140 update(option())
141 },
142 })
143 }
144
145 registerOptionEffect(options.client, (value) => {
146 devtools.setClient(value ?? injectedClient!)

Callers 1

withDevtoolsFunction · 0.85

Calls 1

updateFunction · 0.85

Tested by

no test coverage detected