mvflow / net.pedroloureiro.mvflow / MVFlow

MVFlow

fun <State, Action, Mutation> MVFlow(initialState: State, handler: Handler<State, Action, Mutation>, reducer: Reducer<State, Mutation>, mvflowCoroutineScope: CoroutineScope, defaultLogger: Logger = {}): MVFlow<State, Action> (source)

Constructs a MVFlow object.

Parameters

mvflowCoroutineScope - the CoroutineScope of this object. This means that this scope will be cancelled when this object should go away (it needs to be cancelled outside this object). This way any on-going work will be cancelled which prevents leaks and avoidable work from being executed.

defaultLogger - a logger that can be used to show what is happening inside the object.

fun <State, Action, Mutation, Effect> MVFlow(initialState: State, handler: HandlerWithEffects<State, Action, Mutation, Effect>, reducer: Reducer<State, Mutation>, mvflowCoroutineScope: CoroutineScope, defaultLogger: Logger = {}): MVFlowWithEffects<State, Action, Effect> (source)

Constructs a MVFlow object with side effects.

Parameters

mvflowCoroutineScope - the CoroutineScope of this object. This means that this scope will be cancelled when this object should go away (it needs to be cancelled outside this object). This way any on-going work will be cancelled which prevents leaks and avoidable work from being executed.

defaultLogger - a logger that can be used to show what is happening inside the object.