package com.correx.core.router

import com.correx.core.events.events.StoredEvent
import com.correx.core.router.model.RouterState
import com.correx.core.sessions.projections.Projection

class RouterProjector(
    private val reducer: RouterReducer,
) : Projection<RouterState> {

    override fun initial(): RouterState = reducer.initial

    override fun apply(state: RouterState, event: StoredEvent): RouterState =
        reducer.reduce(state, event)
}
