2019-10-29 07:20:54 +00:00
|
|
|
import BaseActionCableConnector from '../../shared/helpers/BaseActionCableConnector';
|
|
|
|
|
|
|
|
class ActionCableConnector extends BaseActionCableConnector {
|
|
|
|
constructor(app, pubsubToken) {
|
|
|
|
super(app, pubsubToken);
|
|
|
|
this.events = {
|
|
|
|
'message.created': this.onMessageCreated,
|
|
|
|
};
|
2019-10-30 05:13:11 +00:00
|
|
|
console.log('joined', app, pubsubToken);
|
2019-10-29 07:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onMessageCreated = data => {
|
|
|
|
this.app.$store.dispatch('conversation/addMessage', data);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ActionCableConnector;
|