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

Function layerWebSocket

packages/platform/deno/src/DenoSocket.ts:288–293  ·  view source on GitHub ↗
(url: string, options?: {
  readonly closeCodeIsError?: (code: number) => boolean
})

Source from the content-addressed store, hash-verified

286 * @since 4.0.0
287 */
288export const layerWebSocket = (url: string, options?: {
289 readonly closeCodeIsError?: (code: number) => boolean
290}): Layer.Layer<Socket.Socket> =>
291 Layer.effect(Socket.Socket, Socket.makeWebSocket(url, options)).pipe(
292 Layer.provide(layerWebSocketConstructor)
293 )
294
295/**
296 * Provides the WebSocket constructor backed by `globalThis.WebSocket`.

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
provideMethod · 0.45

Tested by

no test coverage detected