Hyperlinkv0.8.0-beta.28

Hyperlink

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

Dial a resource 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 EFFECT_PM_CLIENT_HOST is set.

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