UNPKG

haystack-react

Version:

Project Haystack utilities for building React applications

28 lines (27 loc) 943 B
import { Ids } from 'haystack-nclient'; import { GridRefreshResult } from './client'; /** * A grid refresh watch result. */ export interface GridRefreshWatchResult extends GridRefreshResult { /** * The number of times the underlying watch has updated the grid result. */ updates: number; } /** * A hook to watch some live haystack data. * * @param options.ids The ids of the records to watch. Alternatively a `filter` can be specified. * @param options.filter The haystack filter to query on the server. Alternatively record `ids` * can be specified. * @param options.display An optional display name for the filter. * @param options.pollRate An optional poll rate for the watch in seconds. * @returns A result that wraps a grid. */ export declare function useWatch({ filter, ids, display, pollRate, }: { filter?: string; ids?: Ids; display?: string; pollRate?: number; }): GridRefreshWatchResult;