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

16 lines
446 B
Scala
Raw Normal View History

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