Skip to content
Permalink
Browse files

Step 9.17: Subscribe to users

  • Loading branch information...
dotansimha authored and darkbasic committed Jan 24, 2017
1 parent b5b1da6 commit 6c8162c57402a1e83b1e4a80c8853dabc3579aba
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 6c8162c

Please sign in to comment.
You can’t perform that action at this time.