outwatch-test/src/main/scala/outwatchapp/util/reactive/store/package.scala

19 lines
552 B
Scala
Raw Normal View History

2020-12-27 14:58:19 +00:00
package nova.monadic_sfx.util.reactive
import monix.reactive.Observable
import monix.reactive.Observer
package object store {
type MonixProSubject[-I, +O] = Observable[O] with Observer[I]
type Middleware[A, M] = Observable[(A, M)] => Observable[(A, M)]
type Store[A, M] = MonixProSubject[A, (A, M)]
/**
* A Function that applies an Action onto the Stores current state.
* @param reducer The reducing function
* @tparam A The Action Type
* @tparam M The Model Type
*/
type Reducer[A, M] = (M, A) => (M, Observable[A])
}