emit method

void emit(
  1. Event event, {
  2. PheasantTemplate? templateState,
})

Function used to emit state changes in a PheasantTemplate object.

This function creates, emits and registers a StateChange by making use of event and templateState.

The function then registers the change and adds it to the Stream.

Implementation

void emit(Event event, {PheasantTemplate? templateState}) {
  if (!_frozen) {
    StateChange<PheasantTemplate> change = StateChange(
        triggerEvent: event, newValue: templateState); // Set state change
    emitter.emit(); // Unimplemented yet
    _streamChange(templateState, change);
    receiver.receive(); // Unimplemented yet
  }
}