sveltejs / sveltejs/kit

Add `pending` to `query` functions

Open
#14,900 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

Similar to https://github.com/sveltejs/kit/issues/14080 but for query functions.

Would be nice to have pending state of a query in script while it's resolved somewhere deep in the template.

Describe the proposed solution
<script lang="ts">
  import { getTags } from '$lib/remote/get-tags.remote.ts'

  const buttonDisabled = $derived(getTags.pending)
</script>
Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing query-function implementation and the related issue #14080. Trace how a query resolved deep in the template is represented in script, using the getTags example as the intended entry point. Done means query functions expose a usable pending state such as getTags.pending.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.