ev => data
This commit is contained in:
parent
1cc72fdd73
commit
8cafc4ee55
|
@ -65,36 +65,36 @@ export default class Connection {
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
private onUserEvent(ev: StreamMessages['user']['spec']) { // { type, body }と展開すると型も展開されてしまう
|
private onUserEvent(data: StreamMessages['user']['spec']) { // { type, body }と展開すると型も展開されてしまう
|
||||||
switch (ev.type) {
|
switch (data.type) {
|
||||||
case 'follow':
|
case 'follow':
|
||||||
this.following.add(ev.body.id);
|
this.following.add(data.body.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'unfollow':
|
case 'unfollow':
|
||||||
this.following.delete(ev.body.id);
|
this.following.delete(data.body.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mute':
|
case 'mute':
|
||||||
this.muting.add(ev.body.id);
|
this.muting.add(data.body.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'unmute':
|
case 'unmute':
|
||||||
this.muting.delete(ev.body.id);
|
this.muting.delete(data.body.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// TODO: block events
|
// TODO: block events
|
||||||
|
|
||||||
case 'followChannel':
|
case 'followChannel':
|
||||||
this.followingChannels.add(ev.body.id);
|
this.followingChannels.add(data.body.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'unfollowChannel':
|
case 'unfollowChannel':
|
||||||
this.followingChannels.delete(ev.body.id);
|
this.followingChannels.delete(data.body.id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'updateUserProfile':
|
case 'updateUserProfile':
|
||||||
this.userProfile = ev.body;
|
this.userProfile = data.body;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'terminate':
|
case 'terminate':
|
||||||
|
|
Loading…
Reference in New Issue