feat(ui): create debounced metadata/workflow query hooks

Also added config options for metadata and workflow debounce times (`metadataFetchDebounce` & `workflowFetchDebounce`).

Falls back to 0 if not provided.

In OSS, because we have no major latency concerns, the debounce is 0. But in other environments, it may be desirable to set this to something like 300ms.
This commit is contained in:
psychedelicious
2023-10-18 21:23:09 +11:00
parent 2faed653d7
commit f04462973b
7 changed files with 62 additions and 42 deletions

View File

@ -7,7 +7,6 @@ export const workflowsApi = api.injectEndpoints({
endpoints: (build) => ({
getWorkflow: build.query<Workflow | undefined, string>({
query: (workflow_id) => `workflows/i/${workflow_id}`,
keepUnusedDataFor: 86400, // 24 hours
providesTags: (result, error, workflow_id) => [
{ type: 'Workflow', id: workflow_id },
],