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

Function optionValue

packages/vue/src/query.ts:418–446  ·  view source on GitHub ↗
(
  arr: I | WatchSource<I> | undefined | WatchSource<Option.Option<I>>,
  options?: { readonly mode?: "optional"; readonly enabled?: MaybeRefOrGetter<boolean | undefined> }
)

Source from the content-addressed store, hash-verified

416 ] as const,
417 {
418 ...view,
419 data
420 }
421 )
422 })
423
424 return Effect.runPromise(eff, { signal })
425}
426
427export type StreamQueryPullValue<A> = {
428 readonly done: boolean
429 readonly items: ReadonlyArray<A>
430}
431
432export interface StreamQueryView<A, E> {
433 readonly result: ComputedRef<Atom.PullResult<A, E>>
434 readonly items: ComputedRef<ReadonlyArray<A>>
435 readonly latest: ComputedRef<A | undefined>
436 readonly done: ComputedRef<boolean>
437 readonly awaitResult: () => Effect.Effect<StreamQueryPullValue<A>, E | Cause.NoSuchElementError, never>
438 readonly pull: () => void
439 readonly pullAndAwait: () => Effect.Effect<StreamQueryPullValue<A>, E | Cause.NoSuchElementError, never>
440 readonly refresh: () => void
441 readonly registry: ReturnType<typeof injectRegistry>
442 readonly atom: ComputedRef<Atom.Writable<Atom.PullResult<A, E>, void>>
443}
444
445export const useAtomStreamQuery = <A, E>(
446 atom: () => Atom.Writable<Atom.PullResult<A, E>, void>
447): StreamQueryView<A, E> => {
448 const registry = injectRegistry()
449 const atomRef = computed(atom)

Callers 1

makeQueryViewFunction · 0.85

Calls 1

computedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…