MCPcopy Create free account
hub / github.com/TanStack/db / toValue

Function toValue

packages/svelte-db/src/useLiveQuery.svelte.ts:64–69  ·  view source on GitHub ↗
(value: MaybeGetter<T>)

Source from the content-addressed store, hash-verified

62type MaybeGetter<T> = T | (() => T)
63
64function toValue<T>(value: MaybeGetter<T>): T {
65 if (typeof value === `function`) {
66 return (value as () => T)()
67 }
68 return value
69}
70
71/**
72 * Create a live query using a query function

Callers 2

useLiveQueryFunction · 0.85
useLiveQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected