cable.subscribe(
"Chat", // either "Chat" and "ChatChannel" is fine
channelParams: { "room": "private" },
onSubscribed: (){}, // `confirm_subscription` received
onDisconnected: (){}, // `disconnect` received
onMessage: (Map message) {} // any other message received
);
Unsubscribing from a channel 🎃
cable.unsubscribe(
"Chat", // either "Chat" and "ChatChannel" is fine
{"room": "private"}
);
Perform an action on your ActionCable server 🎇
Requires that you have a method defined in your Rails Action Cable channel whose name matches the action property passed in.