ServerSentEvent.json constructor
The payload, encoded as JSON.
A convenience for the common case; anything else can use data.
Implementation
factory ServerSentEvent.json(
Object? value, {
String? event,
String? id,
}) =>
ServerSentEvent(data: jsonEncode(value), event: event, id: id);