MCPcopy Create free account
hub / github.com/Effect-TS/effect / layerWebSocket

Function layerWebSocket

packages/platform/browser/src/BrowserSocket.ts:38–43  ·  view source on GitHub ↗
(url: string, options?: {
  readonly closeCodeIsError?: (code: number) => boolean
})

Source from the content-addressed store, hash-verified

36 * @since 4.0.0
37 */
38export const layerWebSocket = (url: string, options?: {
39 readonly closeCodeIsError?: (code: number) => boolean
40}): Layer.Layer<Socket.Socket> =>
41 Layer.effect(Socket.Socket, Socket.makeWebSocket(url, options)).pipe(
42 Layer.provide(layerWebSocketConstructor)
43 )
44
45/**
46 * Layer that provides a `WebSocketConstructor` service backed by `globalThis.WebSocket`.

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
provideMethod · 0.45

Tested by

no test coverage detected