Closed kevinelliott closed 5 years ago
Hello @kevinelliott! What version of the library are you using? If it's not v1.2.4 please update to v1.2.4.
Hi @mclintprojects ... yes, I'm using 1.2.4
.
actioncable-vue@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/actioncable-vue/-/actioncable-vue-1.2.4.tgz#8df6a244c2ba04847295f07575b3c7428f000e76"
dependencies:
actioncable "^5.2.2"
@kevinelliott I just checked and it works. You should be able to do this.something() and have it work just fine. Can I please see a snippet of your code?
channels: {
ChatChannel: {
received(data) {
switch (data.type) {
case "new_message":
this.updateConvo(data.payload);
break;
case "new_convo":
this.addConvo(data.payload);
break;
}
}
}
}
That's a snippet of my code and it works fine.
Hi @kevinelliott, I'm closing this issue because everything seems to be in order. Let me know if otherwise.
I would like to call methods defined in the component that subscribed to the channel. How can I access
this.something()
from thereceived(data)
event handler?