Hyperlinkv0.9.0-beta.0

Hyperlink

Hyperlink.connectconstsrc/Hyperlink.ts:4825
<Self, S extends Spec, E = never>(
  tag: HyperlinkTag<Self, S>,
  protocol: Layer.Layer<RpcClient.Protocol, E>
): Layer.Layer<Self, E | ValueErrorsOf<S>>

Dial a HyperService tag over a transport you provide — the no-batteries client. connect bakes in no transport of its own (unlike http / ws / unix / nPipe, whose wire is in the name and bundled): you hand it a protocolHttp / protocolWebsocket / protocolIpc layer, so a browser build pulls in only the one wire it passes.

program.pipe(Effect.provide(Hyperlink.connect(Emails, Hyperlink.protocolHttp(3009))));       // server
program.pipe(Effect.provide(Hyperlink.connect(Emails, Hyperlink.protocolWebsocket("/rpc")))); // browser (ws only)

The port shorthand (3009) resolves against clientHost (default "localhost"), so the same 3009 points at your production host once HYPERLINK_CLIENT_HOST is set.

Replaces the retired clientHttp(tag, target) — use connect(tag, protocolHttp(target)).

Source src/Hyperlink.ts:48255 lines
export const connect = <Self, S extends Spec, E = never>(
  tag: HyperlinkTag<Self, S>,
  protocol: Layer.Layer<RpcClient.Protocol, E>,
): Layer.Layer<Self, E | ValueErrorsOf<S>> =>
  clientLayer(tag).pipe(Layer.provide(protocol));