MCPcopy
hub / github.com/buildship-ai/rowy / IUseFirestoreDocWithAtomOptions

Interface IUseFirestoreDocWithAtomOptions

src/hooks/useFirestoreDocWithAtom.ts:24–35  ·  view source on GitHub ↗

Options for useFirestoreDocWithAtom

Source from the content-addressed store, hash-verified

22
23/** Options for {@link useFirestoreDocWithAtom} */
24interface IUseFirestoreDocWithAtomOptions<T> {
25 /** Additional path segments appended to the path. If any are undefined, the listener isn’t created at all. */
26 pathSegments?: Array<string | undefined>;
27 /** Called when an error occurs. Make sure to wrap in useCallback! If not provided, errors trigger the nearest ErrorBoundary. */
28 onError?: (error: FirestoreError) => void;
29 /** Optionally disable Suspense */
30 disableSuspense?: boolean;
31 /** Optionally create the document if it doesn’t exist with the following data */
32 createIfNonExistent?: T;
33 /** Set this atom’s value to a function that updates the document. Uses same scope as `dataScope`. */
34 updateDataAtom?: PrimitiveAtom<UpdateDocFunction<T> | undefined>;
35}
36
37/**
38 * Attaches a listener for a Firestore document and unsubscribes on unmount.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected