mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Fixed web_ui websocket type error
This commit is contained in:
1 file changed
+2
-2
@@ -213,7 +213,7 @@ export class EventSubscriber<T, V=T> {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private event: EventClass<T> | ChannelEventClass<T>,
|
private event: EventClass<T> | ChannelEventClass<T>,
|
||||||
private prehandler?: (event: Event<T>) => V,
|
private prehandler?: (event: T) => V,
|
||||||
control?: Link
|
control?: Link
|
||||||
) {
|
) {
|
||||||
const entry = Link._eventsByClass.get(this.event);
|
const entry = Link._eventsByClass.get(this.event);
|
||||||
@@ -231,7 +231,7 @@ export class EventSubscriber<T, V=T> {
|
|||||||
async _handle(response: Event<T> | ChannelEvent<T>) {
|
async _handle(response: Event<T> | ChannelEvent<T>) {
|
||||||
this.lastResponse = response;
|
this.lastResponse = response;
|
||||||
this.lastResponseTime = Date.now();
|
this.lastResponseTime = Date.now();
|
||||||
const value = this.prehandler ? this.prehandler(response) : response as any;
|
const value = this.prehandler ? this.prehandler(response as T) : response as any;
|
||||||
for (let callback of this._callbacks) {
|
for (let callback of this._callbacks) {
|
||||||
callback(value);
|
callback(value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user