package com.correx.core.context

import com.correx.core.context.state.ContextState
import com.correx.core.events.events.StoredEvent
import com.correx.core.sessions.projections.Projection

class ContextProjector(
    private val reducer: ContextReducer
) : Projection<ContextState> {
    override fun initial(): ContextState = ContextState()
    override fun apply(state: ContextState, event: StoredEvent): ContextState =
        reducer.reduce(state, event)
}
