Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

createUseRpcQuery

función Since 1.1.0

Crea useRpcQuery para los procedimientos de un manifiesto público, como hacen los clientes generados.

ts
import { createUseRpcQuery } from "@meekojs/meeko/framework";

Source code src/app/composables/resources/use-rpc-query.ts:25

Firma #

ts
function createUseRpcQuery<Contract extends Record<string, RpcOperation>>(manifest: Pick<PublicServerManifest, "rpc">, options?: ClientOptions): UseRpcQuery<Contract>

Type parameters #

Contract extends Record<string, RpcOperation>

Parameters #

manifest Pick<PublicServerManifest, 'rpc'>

Manifiesto público con la lista rpc.

options ClientOptions optional

Opciones de transporte: fetch, baseUrl, cabeceras y CSRF.

Returns #

UseRpcQuery<Contract>

El composable useRpcQuery. Con un procedimiento desconocido lanza TypeError.

Example #

ts
import { createBrowserClientOptions, createUseRpcQuery } from "@meekojs/meeko/framework";
import type { RpcContract } from "../types/server-contracts.js";

const manifest = { version: 1, api: [], rpc: [{ id: "users.get", pathname: "/_meeko/rpc/users/get" }] } as const;
export const useRpcQuery = createUseRpcQuery<RpcContract>(manifest, createBrowserClientOptions());

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/app/composables/resources/use-rpc-query.ts