{note.data.title}
{note.data.body}
Loading…
; return (Block #{blockNumber}, balance: {free}
); } ```Loading…
Block #{{ blockNumber }}, balance: {{ free }}
```{error.message}
} > ); } return ( <>{{ error.message }}
{error.message}
} > ); } ```{{ error.message }}
```Login was declined.
} {error &&{error.message}
} > ); } ```Login was declined.
{{ error.message }}
```No account selected.
; return (
{account.name ?? "Unnamed"}: {truncateAddress(account.address)}
No account selected.
{{ account.name ?? "Unnamed" }}: {{ truncateAddress(account.address) }}
{error.message}
} > ); } ```{{ error.message }}
```Checking identity…
; if (!userId) { return ( ); } returnHello, {userId}!
; } ```Checking identity…
Hello, {{ userId }}!
```Connect a wallet first.
; if (isPending) returnLoading balance…
; if (error) returnFailed to load balance: {error.message}
; return{free} free, {balance.reserved.toString()} reserved
; } ```Connect a wallet first.
Loading balance…
Failed to load balance: {{ error.message }}
{{ free }} free, {{ balance.reserved }} reserved
``` Pass a getter (`() => account.value?.address`) so the subscription follows the address when it changes.Connecting…
; if (error) returnLost the chain: {error.message}
; returnBest block: #{blockNumber}
; } ```Connecting…
Lost the chain: {{ error.message }}
Best block: #{{ blockNumber }}
```Connecting…
; if (error) returnFailed to connect: {error.message}
; return ( ); } ```Connecting…
Failed to connect: {{ error.message }}
```Connect a wallet first.
; if (isPending) returnLoading account…
; if (error) returnFailed to read account: {error.message}
; return (Nonce {data.nonce}, free {data.data.free.toString()} planck
); } ```Connect a wallet first.
Loading account…
Failed to read account: {{ error.message }}
Nonce {{ data.nonce }}, free {{ data.data.free }} planck
``` Pass getters in `deps` (and for `enabled`) so the read follows the reactive value when it changes.Loading chain info…
; if (error) returnFailed to load chain spec: {error.message}
; if (!spec) returnChain spec unavailable (running standalone).
; return ({spec.name}: token {spec.properties?.tokenSymbol} with{" "} {spec.properties?.tokenDecimals} decimals
); } ```Loading chain info…
Failed to load chain spec: {{ error.message }}
Chain spec unavailable (running standalone).
{{ spec.name }}: token {{ spec.properties?.tokenSymbol }} with {{ spec.properties?.tokenDecimals }} decimals
```Waiting for the chain…
; if (error) returnSubscription failed: {error.message}
; returnOn-chain time: {new Date(Number(now)).toLocaleTimeString()}
; } ```Waiting for the chain…
Subscription failed: {{ error.message }}
On-chain time: {{ time }}
```Connecting…
; if (error) returnFailed to connect: {error.message}
; return ( ); } ```Connecting…
Failed to connect: {{ error.message }}
```Chat unavailable: {error.message}
; return ( ); } ```Chat unavailable: {{ error.message }}
```Opening room…
; if (roomError) returnChat unavailable: {roomError.message}
; return ( <> {error &&{error.message}
}Opening room…
Chat unavailable: {{ roomError.message }}
{{ error.message }}
Opening room…
; if (error) returnChat unavailable: {error.message}
; returnRoom ready ({status === "New" ? "just created" : "already existed"}).
; } ```Opening room…
Chat unavailable: {{ error.message }}
Room ready ({{ status === "New" ? "just created" : "already existed" }}).
```Chat unavailable: {error.message}
; if (!rooms?.length) returnNo rooms yet.
; return (Chat unavailable: {{ error.message }}
No rooms yet.
Enter a contract address.
; if (contract.error) returnFailed to load contract: {contract.error.message}
; returnCount: {count.data?.toString() ?? "…"}
; } ```Enter a contract address.
Failed to load contract: {{ contract.error.message }}
Count: {{ count.data?.toString() ?? "…" }}
``` Pass a getter (`() => props.address`) so the handle re-resolves when the address changes, and pass the whole `contract` query result to the downstream composables.Reading count…
; if (count.error) returnRead failed: {count.error.message}
; return (Count: {count.data.toString()}{" "}
); } ``` In React, pass the resolved handle, `contract.data`, as the first argument.Reading count…
Read failed: {{ count.error.message }}
Count: {{ count.data?.toString() }}
``` In Vue, pass the whole query result returned by `useContract` or `useContractAt`; the read unwraps `contract.data` reactively and enables itself once the handle resolves. Args may be a getter (`() => [props.id]`) so reactive args re-run the read.Count: {count.data?.toString() ?? "…"}
{increment.error &&{increment.error.message}
} > ); } ``` In React, pass the resolved handle, `contract.data`, as the first argument.Count: {{ count.data?.toString() ?? "…" }}
{{ increment.error.message }}
``` In Vue, pass the whole query result returned by `useContract` or `useContractAt`; the write unwraps `contract.data` when it runs.Resolving contract…
; if (contract.error) returnFailed to load contract: {contract.error.message}
; returnCount: {count.data?.toString() ?? "…"}
; } ``` In React, pass the resolved handle, `contract.data`, to `useContractQuery` and `useContractTx`.Resolving contract…
Failed to load contract: {{ contract.error.message }}
Count: {{ count.data?.toString() ?? "…" }}
``` In Vue, pass the whole `contract` query result to `useContractQuery` and `useContractTx`; they unwrap `contract.data` reactively.{mapAccount.error.message}
} > ); } ```{{ mapAccount.error.message }}
```{free || "Loading…"}
; } ```{{ free || "Loading…" }}
``` Pass a getter (`() => balance.value?.free`) for reactive values; the computed string updates as the balance changes.{error.message}
} > ); } ```{{ error.message }}
```{error.message}
} > ); } ```{{ error.message }}
```Checking chain support…
; if (!supported) returnThis host does not support the People chain.
; returnChecking chain support…
This host does not support the chain.
``` Pass a getter for reactive features; the query re-runs when the value changes.Detecting environment…
; return ( <> {mode === "standalone" && ( )} {children} > ); } ```Detecting environment…
Loading settings…
; return ( ); } ```Loading settings…
``` The key can be a getter (`() => "draft:" + props.id`); the query re-runs and the writers retarget when it changes.{error.message}
} > ); } ```{{ error.message }}
```{error.message}
} > ); } ```{{ error.message }}
```{error.message}
} > ); } ```{{ error.message }}
```Payments unavailable: {error.message}
; if (isPending) returnLoading balance…
; returnAvailable: {available}
; } ```Payments unavailable: {{ error.message }}
Loading balance…
Available: {{ available }}
```{error.message}
; switch (status?.tag) { case "Processing": returnPayment processing…
; case "Completed": returnPayment completed ✓
; case "Failed": returnPayment failed: {status.value.reason}
; default: returnWaiting for status…
; } } ```{{ error.message }}
Payment processing…
Payment completed ✓
Payment failed: {{ status.value.reason }}
Waiting for status…
``` Pass the id as a getter (`() => props.paymentId`): the subscription attaches when the id appears and re-attaches when it changes.{error.message}
} {status?.tag === "Processing" &&Payment processing…
} {status?.tag === "Completed" &&Paid ✓
} {status?.tag === "Failed" &&Failed: {status.value.reason}
}Balance: {available}
> ); } ``` A rejected request throws out of `request`, so an async handler like `onPay` should be the only place that awaits it; the same error also lands in `error`.{{ error.message }}
Payment processing…
Paid ✓
Failed: {{ status.value.reason }}
Balance: {{ available }}
``` Pass the payment id to `usePaymentStatus` as a getter (`() => paymentId.value`) so the status subscription attaches once the id exists.Purse funded ✓
} {error &&{error.message}
} > ); } ```Purse funded ✓
{{ error.message }}
```{error.message}
}{{ error.message }}
Presence unavailable (running standalone).
; return (Presence unavailable (running standalone).
No note stored yet.
; if (note.isPending) returnFetching {cid}…
; if (note.error) returnFailed to fetch: {note.error.message}
; return ({note.data.body}
No note stored yet.
Fetching {{ props.cid }}…
Failed to fetch: {{ note.error.message }}
{{ note.data?.body }}
Checking quota…
; if (error) returnQuota check failed: {error.message}
; if (!status.authorized) returnThis account is not authorized to store data.
; return (Quota: {status.remainingTransactions} uploads /{" "} {status.remainingBytes.toString()} bytes, until block {status.expiration}
); } ```Checking quota…
Quota check failed: {{ error.message }}
This account is not authorized to store data.
Quota: {{ status.remainingTransactions }} uploads / {{ status.remainingBytes }} bytes, until block {{ status.expiration }}
``` Pass a getter (`() => account.value?.address`) when checking a reactive address, so the check re-runs when the value changes.{upload.error.message}
} {cid &&Stored as {cid}, reads back: {stored.data?.title ?? "fetching…"}
} > ); } ```{{ upload.error.message }}
Stored as {{ cid }}, reads back: {{ stored.data?.title ?? "fetching…" }}
```{error.message}
} > ); } ```{{ error.message }}
```{error.message}
} > ); } ```{{ error.message }}
```