emit method

void emit(
  1. String key,
  2. Response data, {
  3. dynamic model,
  4. bool isSyncing = false,
  5. DateTime? timestamp,
})

Emits a new event to all observers.

Implementation

void emit(
  String key,
  Response data, {
  dynamic model,
  bool isSyncing = false,
  DateTime? timestamp,
}) {
  if (!_responseController.isClosed) {
    _responseController.add(
      LikeEvent(
        key: key,
        response: data,
        model: model,
        isSyncing: isSyncing,
        timestamp: timestamp ?? DateTime.now(),
      ),
    );
  }
}