0.3.0 (deprecated)Client
This documentation is deprecated. It covers rspc 0.3.0, which is no longer maintained.
Svelte Client
rspc can be used on the frontend with Svelte via Tanstack Svelte Query which provides caching, refetching and a lot more.
To get started first install the required packages.
npm i @rspc/client # The core client
npm i @rspc/svelte-query # The integrationThen you can do the following:
<script lang="ts">
import { createSvelteQueryHooks } from "@rspc/svelte-query";
import type { Procedures } from "../../../../bindings.ts";
const rspc = createSvelteQueryHooks<Procedures>();
const version = rspc.createQuery(["version"]);
</script>
<div>
<p>Using rspc version: {$version.data}</p>
</div>Edit on GitHub
Last updated on
