Create a typed proxy for a remote API exposed on the other side of a transport.
Use this for the common client-only case. The returned proxy is registered for disposal, so dispose(proxy) tears down the underlying channel.
dispose(proxy)
import { wrap } from "kkrpc"import { webSocketClientTransport } from "kkrpc/ws"const api = wrap<RemoteAPI>(webSocketClientTransport({ url: "ws://localhost:3000" }))console.log(await api.ping()) Copy
import { wrap } from "kkrpc"import { webSocketClientTransport } from "kkrpc/ws"const api = wrap<RemoteAPI>(webSocketClientTransport({ url: "ws://localhost:3000" }))console.log(await api.ping())
Create a typed proxy for a remote API exposed on the other side of a transport.
Use this for the common client-only case. The returned proxy is registered for disposal, so
dispose(proxy)tears down the underlying channel.