MCPcopy Index your code
hub / github.com/Effect-TS/effect / makeWebSocketChannel

Function makeWebSocketChannel

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

Source from the content-addressed store, hash-verified

523 * @category constructors
524 */
525export const makeWebSocketChannel = <IE = never>(
526 url: string,
527 options?: {
528 readonly closeCodeIsError?: (code: number) => boolean
529 }
530): Channel.Channel<
531 Chunk.Chunk<Uint8Array>,
532 Chunk.Chunk<Uint8Array | string | CloseEvent>,
533 SocketError | IE,
534 IE,
535 void,
536 unknown,
537 WebSocketConstructor
538> =>
539 Channel.unwrapScoped(
540 Effect.map(makeWebSocket(url, options), toChannelWith<IE>())
541 )
542
543/**
544 * @since 1.0.0

Callers

nothing calls this directly

Calls 3

makeWebSocketFunction · 0.85
toChannelWithFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected