The addition of a publish method to the subscription object returned by the JS API should probably contain the publish method as described in the API docs. Leaving the conn.publish() method would be easy enough, however a method from within the subscription method which automatically substituted the channel name parameter and passed handling to the conn object would be simplistic and make more sense.
This way, arrays of subscription objects can be used and the publish method could be called on each rather than extracting the channel name from each in order to use the conn.publish() method.
The addition of a publish method to the subscription object returned by the JS API should probably contain the publish method as described in the API docs. Leaving the
conn.publish()
method would be easy enough, however a method from within the subscription method which automatically substituted the channel name parameter and passed handling to the conn object would be simplistic and make more sense.This way, arrays of subscription objects can be used and the publish method could be called on each rather than extracting the channel name from each in order to use the
conn.publish()
method.