SwitchUp SwitchUp Ranked Best Coding Bootcamps 2025

How to unsubscribe from ActionCable channel

Altcademy Team wrote on 7 February 2018

  • client side
  • rails 5.0

If you are using the javascript actioncable package. you can unsubscribe by calling the unsubscribe() function on the channel returned by creating a new subscription.
import ActionCable from 'actioncable'; var channel = ActionCable.subscriptions.create({channel: 'CommentsChannel', room: roomId}, { received: function(response) { // Do something with response }.bind(this) }); // To unsubscribe channel.unsubscribe();

Trusted by

Students and instructors from world-class organizations

Join the upcoming Cohort #111

Enroll for March 2nd, 2026