UNPKG

react-firehooks

Version:

Lightweight dependency-free collection of React hooks for Firebase

11 lines (10 loc) 608 B
import { ValueHookResult } from "../common/index.js"; import { LoadingState } from "./useLoadingValue.js"; /** * @internal */ export type UseListenOnChange<Value, Error, Reference> = (ref: Reference, onValue: (value: Value | undefined) => void, onError: (e: Error) => void) => () => void; /** * @internal */ export declare function useListen<Value, Error, Reference>(reference: Reference | undefined, onChange: UseListenOnChange<Value, Error, Reference>, isEqual: (a: Reference | undefined, b: Reference | undefined) => boolean, initialState: Value | typeof LoadingState): ValueHookResult<Value, Error>;