on method

PusherChannel on(
  1. String event,
  2. Function callback
)

Bind a channel to an event.

Implementation

PusherChannel on(String event, Function callback) {
  subscription.bind(event, (event) => callback(event?.data));
  return this;
}