ChannelEvent<T> class final

One typed event on one channel: the realtime twin of Endpoint<T>.

ChannelEvent<OrderUpdated> orderUpdated(int id) => ChannelEvent(
  channel: 'private-orders.$id',
  event: 'OrderUpdated',
  decode: (json) => OrderUpdated.fromJson(json! as Map<String, Object?>),
);

event is what the server's broadcastAs() returns, and channel what its broadcastOn() names, prefix included.

Constructors

ChannelEvent({required String channel, required String event, required T decode(Object? json)})
const

Properties

channel String
final
decode → T Function(Object? json)
final
event String
final
hashCode int
The hash code for this object.
no setterinherited
requiresAuthorization bool
Private and presence channels are the ones needing a signature from the application before Thoth will let a socket subscribe.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited