refactor: move event system to reducer, remove engine package #32
Reference in New Issue
Block a user
Delete Branch "refactor/move-events-to-reducer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
This PR completes the MVC-inspired refactoring by moving the event system from the engine into the reducer.
The engine package is now removed entirely, as the reducer handles both reduction logic and lifecycle events.
pkg/reducer/events.gowithStartEvent,StepEvent, andStopEvent.Reducerinterface to embedEmitter[Event]and addExpression()method.NormalOrderReducerto embedBaseEmitterand emit lifecycle events during reduction.Reducerinstead ofEngine.internal/enginepackage entirely.Off()method toBaseEmitterto complete theEmitterinterface.Emitter.Onsignature to use generic typeEinstead ofstring.Decisions
Reducerinterface now combines reduction logic with event emission, making it the single orchestration point.Expression()method onReducerprovides access to current state for plugins.Benefits
Reducerimplementation.Reducerwith embedded emitter.Checklist
<type>/<description>).