@dyadpy/solid
v0.3.0
Published
Deprecated shim. @dyadpy/solid has been renamed to @causewayjs/solid — install that instead.
Readme
@dyadpy/solid
SolidJS resource bindings for Dyadpy-generated
clients. Three factory functions on top of the typed api:
| Resource | What it does |
| -------------- | -------------------------------------------------------------------------- |
| query | createResource-backed unary call; reactive on the args accessor. |
| mutation | Imperative mutate(args) with data/error/loading signals. |
| subscription | Subscribes to a stream[T] endpoint; events forwarded to an onEvent cb. |
Install
pnpm add @dyadpy/solid @dyadpy/ts solid-jsUse
import { createDyadpyResources } from "@dyadpy/solid";
import { api } from "./lib/dyadpy/client";
const resources = createDyadpyResources(api);
const [issue] = resources.query("getIssue", () => ({ issueId: 1 }));
export default function Issue() {
return (
<Show when={issue()} fallback={<p>Loading…</p>}>
<h1>{issue()!.title}</h1>
</Show>
);
}For a @raises(...) route the error accessor on the query carries the
typed discriminated union.
License
MIT
