subscribe method

Stream<WebsocketResponse> subscribe({
  1. List<ChannelEnum>? channels,
  2. List<String>? productIds,
  3. Map<ChannelEnum, List<String>?>? channelProductIdMap,
})

Subscribe to specific channels.

Implementation

Stream<WebsocketResponse> subscribe({
  List<ChannelEnum>? channels,
  List<String>? productIds,
  Map<ChannelEnum, List<String>?>? channelProductIdMap,
}) {
  if (_channel == null) {
    throw Exception(
      'You must connect before you can subscribe to a channel',
    );
  }
  return _manageSubscriptions(
    action: ActionEnum.subscribe,
    channels: channels,
    productIds: productIds,
    channelProductIdMap: channelProductIdMap,
  );
}