Listener
import { Listener } from "@hyper-fetch/sockets"
Description
Defined in listener/listener.ts:8
Parameters
Name | Details |
---|---|
socket
|
|
listenerOptions
|
|
Properties
connections
connections
Description
Defined in listener/listener.ts:17
Type
Set<ConnectMethodType<AdapterType, Response>>
listenerOptions
listenerOptions
Description
Defined in listener/listener.ts:21
Type
ListenerOptionsType<Endpoint, AdapterType>
Methods
listen()
listen()
Description
Defined in listener/listener.ts:67
Return
(options: ExtractRouteParams<ExtractListenerEndpointType<Listener>> extends NegativeTypes ? {
callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>;
} : (ExtractListenerHasParams<Listener> extends false ? {
callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>;
params: ExtractRouteParams<ExtractListenerEndpointType<Listener>>;
} : {
callback: ListenerCallbackType<Adapter, ExtractListenerResponseType<Listener>>;
params: never;
})) => () => void
clone()
clone()
Preview
clone<Params>(options)
Description
Defined in listener/listener.ts:56
Parameters
Name | Details |
---|---|
options
|
|
Return
Listener<Response, Endpoint, AdapterType, Params>
onData()
onData()
Preview
onData(callback)
Description
Attach global logic to the received events
Defined in listener/listener.ts:51
Parameters
Name | Details |
---|---|
callback
|
|
Return
Listener<Response, Endpoint, AdapterType, HasParams>