Subscribe to an ActionCable Channel specific to a particular view

How would you only subscribe to an ActionCable channel on the client
depending on which view you are in lets say you have a products
controller
and a inventory controller and you wanted to subscribe to the products
channel only when you are on the products view and the inventory channel
only when you are on the inventory view?