Permalink
Browse files

Step 9.17: Subscribe to users

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent 8db6bb9 commit 58d636b0a7b86f4b57515c9511e31999f2a6423e
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/pages/chats/new-chat.ts
@@ -40,7 +40,13 @@ export class NewChatComponent implements OnInit {
}
loadUsers(): void {
this.users = this.findUsers();
// Fetch all users matching search pattern
const subscription = MeteorObservable.subscribe('users');
const autorun = MeteorObservable.autorun();
Observable.merge(subscription, autorun).subscribe(() => {
this.users = this.findUsers();
});
}
findUsers(): Observable<User[]> {

0 comments on commit 58d636b

Please sign in to comment.