console.log(this.user);
}
+ // TODO find all refs to this, make sure everything is well typed
public static get Instance() {
return this._instance || (this._instance = new this());
}
.subscribe();
console.log(`Connected to ${wsUri}`);
+
+ if (UserService.Instance.user) {
+ }
}
public static get Instance() {
return this._instance || (this._instance = new this());
}
+ public userJoin() {
+ this.wsSendWrapper(UserOperation.ListCategories, undefined);
+ }
+
public login(loginForm: LoginForm) {
this.subject.next(this.wsSendWrapper(UserOperation.Login, loginForm));
}
this.subject.next(this.wsSendWrapper(UserOperation.CreatePost, postForm));
}
+ // TODO strictly type these
public getPost(postId: number) {
let data = { id: postId, auth: UserService.Instance.auth };
this.subject.next(this.wsSendWrapper(UserOperation.GetPost, data));