Emitter
import { Emitter } from "@hyper-fetch/sockets"
Description
Defined in emitter/emitter.ts:8
Parameters
Name | Details |
---|---|
socket
|
|
emitterOptions
|
|
json
|
|
dataMapper
|
|
Properties
connections
connections
Description
Defined in emitter/emitter.ts:22
Type
Set<ConnectMethodType<AdapterType, Response>>
emitterOptions
emitterOptions
Description
Defined in emitter/emitter.ts:26
Type
EmitterOptionsType<Endpoint, AdapterType>
Methods
emit()
emit()
Description
Defined in emitter/emitter.ts:127
Return
ExtractEmitterHasDataType<Emitter> extends false ? (options: [object Object]) => string : (ExtractRouteParams<ExtractEmitterEndpointType<Emitter>> extends NegativeTypes ? (options?: [object Object]) => string : (ExtractEmitterHasParamsType<Emitter> extends false ? (options: [object Object]) => string : (options?: [object Object]) => string))
clone()
clone()
Preview
clone<NewPayload, MapperData, Params, Data>(options, mapper)
Description
Defined in emitter/emitter.ts:83
Parameters
Name | Details |
---|---|
options
|
|
mapper
|
|
Return
Emitter<NewPayload, Response, Endpoint, AdapterType, MapperData, Params, Data>
getAck()
getAck()
Preview
getAck(ack)
Description
Defined in emitter/emitter.ts:112
Parameters
Name | Details |
---|---|
ack
|
|
Return
(response: [object Object]) => void
onData()
onData()
Preview
onData(callback)
Description
Attach global logic to the received events
Defined in emitter/emitter.ts:66
Parameters
Name | Details |
---|---|
callback
|
|
Return
Emitter<Payload, Response, Endpoint, AdapterType, MappedData, HasParams, HasData>
setData()
setData()
Preview
setData(data)
Description
Defined in emitter/emitter.ts:47
Parameters
Name | Details |
---|---|
data
|
|
Return
Emitter<MappedData, Response, Endpoint, AdapterType, MappedData, HasParams, true>
setDataMapper()
setDataMapper()
Preview
setDataMapper<MapperData>(mapper)
Description
Defined in emitter/emitter.ts:54
Parameters
Name | Details |
---|---|
mapper
|
|
Return
Emitter<Payload, Response, Endpoint, AdapterType, MapperData, HasParams, HasData>
setOptions()
setOptions()
Preview
setOptions(options)
Description
Defined in emitter/emitter.ts:39
Parameters
Name | Details |
---|---|
options
|
|
Return
Emitter<Payload, Response, Endpoint, AdapterType, MappedData, HasParams, HasData>