mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
tslint changes
This commit is contained in:
@@ -4,31 +4,31 @@ import { ModelTypes } from '../common/adminInterfaces';
|
||||
import { ModelSubscriber } from '../components/services/modelSubscriber';
|
||||
|
||||
export interface ClientUpdate {
|
||||
type: ModelTypes;
|
||||
id: string;
|
||||
update: any;
|
||||
type: ModelTypes;
|
||||
id: string;
|
||||
update: any;
|
||||
}
|
||||
|
||||
export class ClientAdminActions {
|
||||
constructor(private model: AdminModel) {
|
||||
}
|
||||
connected() {
|
||||
this.model.initialize(true);
|
||||
this.model.connectedToSocket();
|
||||
}
|
||||
disconnected() {
|
||||
this.model.updateTitle();
|
||||
}
|
||||
@Method()
|
||||
updates(updates: ClientUpdate[]) {
|
||||
for (const { type, id, update } of updates) {
|
||||
const model = this.model[type] as ModelSubscriber<any>;
|
||||
constructor(private model: AdminModel) {
|
||||
}
|
||||
connected() {
|
||||
this.model.initialize(true);
|
||||
this.model.connectedToSocket();
|
||||
}
|
||||
disconnected() {
|
||||
this.model.updateTitle();
|
||||
}
|
||||
@Method()
|
||||
updates(updates: ClientUpdate[]) {
|
||||
for (const { type, id, update } of updates) {
|
||||
const model = this.model[type] as ModelSubscriber<any>;
|
||||
|
||||
if (model) {
|
||||
model.update(id, update);
|
||||
} else {
|
||||
console.error(`Invalid model type "${type}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (model) {
|
||||
model.update(id, update);
|
||||
} else {
|
||||
console.error(`Invalid model type "${type}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user