MCPcopy Create free account
hub / github.com/effect-app/libs / awaitResult

Function awaitResult

packages/vue/src/internal/tanstackQuery.ts:228–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226 }, queryClient)
227
228 const latestSuccess = shallowRef<TData>()
229 const result = computed((): AsyncResult.AsyncResult<TData, E> =>
230 swrToQuery({
231 error: tanstack.error.value,
232 data: tanstack.data.value === undefined ? latestSuccess.value : tanstack.data.value,
233 isValidating: tanstack.isFetching.value
234 })
235 )
236 watch(result, (value) => latestSuccess.value = Option.getOrUndefined(AsyncResult.value(value)), { immediate: true })
237 const seedLatestSuccess = (data: TData) => {
238 if (latestSuccess.value === undefined) {
239 latestSuccess.value = data
240 }
241 }
242
243 const registry = injectRegistry()
244 const latestSuccessRef = computed(() => latestSuccess.value)
245 const atom = computed<Atom.Atom<AsyncResult.AsyncResult<TData, E>>>(() => Atom.readable(() => result.value))
246
247 const awaitResult = (): Effect.Effect<TData, E> =>

Callers

nothing calls this directly

Calls 4

seedLatestSuccessFunction · 0.85
recoverCauseExceptionFunction · 0.85
catchMethod · 0.80
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…