UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

19 lines (18 loc) 844 B
import { RefetchQuery } from "../../components/query"; /** * Returns a function that refetches the provided task(s) in the background. Any code using these tasks * will be automatically updated when the refetch is complete. * * Tasks can be refetched by slug, slug + params, or by the task function. * If no params are provided, all tasks matching the slug or function will be refetched. * * @example * useRefetchTask()('my_task'); // Refetches all executions of `my_task` regardless of parameters. * * @example * useRefetchTask()({ slug: 'my_task', params: { id: 1 } }); // Refetches executions of `my_task` with `id` = 1. * * @example * useRefetchTask()({ fn: myTask }); // Refetches all executions of the `myTask` function. */ export declare const useRefetchTasks: () => (refetchTasks: RefetchQuery | RefetchQuery[]) => void;