v0.0.1 โ€” Early Alpha

Async state management
for GPUI

TanStack Query-inspired data fetching with caching, retries, and stale-while-revalidate โ€” built for Zed's GPU-accelerated UI framework.

cargo add rs-query

Simple, declarative API

Fetch data with automatic caching and state management

use rs_query::{QueryClient, Query, QueryKey, QueryState, spawn_query};

fn fetch_users(&mut self, cx: &mut Context<Self>) {
    let query = Query::new(
        QueryKey::new("users"),
        || async { api::get_users().await }
    );

    spawn_query(cx, &self.client, &query, |this, state, cx| {
        match state {
            QueryState::Success(users) => this.users = users,
            QueryState::Error { error, .. } => this.error = Some(error),
            QueryState::Stale(users) => this.users = users, // Show while refetching
            _ => {}
        }
        cx.notify();
    });
}

Built for GPUI

Everything you need for async data in your Zed-powered apps

โšก

spawn_query / spawn_mutation

One-liner async execution with automatic state management and context updates.

๐Ÿ“ฆ

Stale-While-Revalidate

Show cached data instantly while fetching fresh data in the background.

๐Ÿ”„

Automatic Retries

Exponential backoff for transient failures with configurable retry counts.

๐Ÿ—‚๏ธ

Hierarchical Cache Keys

Invalidate related queries with pattern matching on nested keys.

โš™๏ธ

Configurable

Stale time, cache time, retry delays, and refetch policies โ€” all customizable.

๐Ÿฆ€

Pure Rust

No JavaScript, no WASM. Native performance with GPUI's reactive model.