Skip to content

Commit

Permalink
add toSubject to VarSource
Browse files Browse the repository at this point in the history
  • Loading branch information
cornerman committed Jun 26, 2024
1 parent 73395fa commit 9a782dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion reactive/src/main/scala/colibri/reactive/Reactive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ object RxWriter {
}
}

trait VarSource[A] extends RxWriter[A] with RxSource[A]
trait VarSource[A] extends RxWriter[A] with RxSource[A] {
final def subject: Subject[A] = Subject.from(observer, observable)
}

trait VarEvent[A] extends VarSource[A] with RxEvent[A] {
final def transformVar[A2](f: RxWriter[A] => RxWriter[A2])(g: RxEvent[A] => RxEvent[A2]): VarEvent[A2] = VarEvent.create(f(this), g(this))
Expand Down

0 comments on commit 9a782dd

Please sign in to comment.