character.js 620 B

12345678910111213141516171819202122
  1. // noinspection JSCheckFunctionSignatures
  2. export const characterQueryKeys = {
  3. root: ["characters"],
  4. options: () => [...characterQueryKeys.root, "options"],
  5. byId: (id) => ["character", id]
  6. }
  7. export const characterListQuery = defineQueryOptions({
  8. key: characterQueryKeys.root,
  9. query: () => useEmit("character:list")
  10. })
  11. export const characterOptionsQuery = defineQueryOptions({
  12. key: characterQueryKeys.options,
  13. query: () => useEmit("character:options")
  14. })
  15. export const characterByIdQuery = defineQueryOptions((id) => ({
  16. key: characterQueryKeys.byId(id),
  17. query: () => useEmit("character:read", id)
  18. }))