Passer au contenu principal

Documentation Index

Fetch the complete documentation index at: https://kubo-47e69177.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Cache Tags

Pourquoi des tags

Les tags permettent un vocabulaire unique d’invalidation entre serveur et client.

Registre cote client

app/providers.tsx
import { setTagRegistry } from "@zapaction/query";

setTagRegistry({
  todos: [["todos"]],
  todoById: ({ input }) => [["todos", "by-id", (input as { id?: string })?.id ?? "unknown"]]
});

Tags sur les actions

app/actions.ts
import { defineAction } from "@zapaction/core";

export const updateTodo = defineAction({
  input: someSchema,
  output: resultSchema,
  tags: ["todos", "todoById"],
  handler: async ({ input }) => updateInDb(input)
});