package com.correx.core.talkie

import com.correx.core.events.events.StoredEvent
import com.correx.core.talkie.model.TalkieState
import com.correx.core.sessions.projections.Projection

class TalkieProjector(
    private val reducer: TalkieReducer,
) : Projection<TalkieState> {

    override fun initial(): TalkieState = reducer.initial

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