Skip to main content
Version: 2.x.x

Listener


import { Listener } from "@hyper-fetch/sockets"

Description

Defined in listener/listener.ts:6

Parameters

NameDetails

socket

Required

Socket<ClientType>

listenerOptions

Optional

ListenerOptionsType<ExtractListenerOptionsType<ClientType>>

Properties

listenerOptions

Description

Defined in listener/listener.ts:12

Type

ListenerOptionsType<ExtractListenerOptionsType<ClientType>>

name

Description

Defined in listener/listener.ts:7

Type

string

options

Description

Defined in listener/listener.ts:8

Type

ExtractListenerOptionsType<ClientType>

socket

Description

Defined in listener/listener.ts:11

Type

Socket<ClientType>

Methods

clone()

Preview

clone(config)

Description

Defined in listener/listener.ts:23

Parameters

NameDetails

config

Optional

Partial<ListenerOptionsType<ExtractListenerOptionsType<ClientType>>>

Return

Listener<ResponseType, ClientType>

listen()

Preview

listen(callback)

Description

Defined in listener/listener.ts:33

Parameters

NameDetails

callback

Required

(data: ListenerCallbackType<ResponseType>) => void

Return

readonly [() => void, (data: ListenerCallbackType<ResponseType>) => void]

setOptions()

Preview

setOptions(options)

Description

Defined in listener/listener.ts:19

Parameters

NameDetails

options

Required

ExtractListenerOptionsType<ClientType>

Return

Listener<ResponseType, ClientType>