summaryrefslogtreecommitdiff
path: root/src/server/api/stream/channels/user-list.ts
blob: 85df4b4f1662a6d0da89bc16da8a4d09b6d72cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import autobind from 'autobind-decorator';
import Channel from '../channel';

export default class extends Channel {
	public readonly chName = 'userList';
	public readonly shouldShare = false;

	@autobind
	public async init(params: any) {
		const listId = params.listId as string;

		// Subscribe stream
		this.subscriber.on(`userListStream:${listId}`, data => {
			this.send(data);
		});
	}
}