Questions tagged [scala.rx]

Scala.Rx is an experimental change propagation library for Scala.

Scala.Rx is an experimental change propagation library for Scala.

https://github.com/lihaoyi/scala.rx

13 questions
8
votes
0 answers

Binding.scala vs Haoyi's Scala.Rx + ScalaTags

How does Binding.scala compare to the concept described here? Apart from the design descriptions one might compare their implementations of TodoMVC: Binding.scala Scala.Rx + ScalaTags Edit: By now I compared them to scalajs-react. I think react…
Tamriel
  • 1,337
  • 1
  • 9
  • 9
5
votes
1 answer

What is the difference between Reactive programming and plain old closures?

Example from scala.rx: import rx._ val a = Var(1); val b = Var(2) val c = Rx{ a() + b() } println(c()) // 3 a() = 4 println(c()) // 6 How is the above version better than: var a = 1; var b = 2 def c = a + b println(c) // 3 a = 4 println(c) //…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
3
votes
1 answer

Scala.Rx with ScalaTags example compilation error

I tried the scala.js example https://github.com/lihaoyi/hands-on-scala-js and its scala.rx with scalatags part in advanced section. Example compiles are runs fine but when I try to use the latest scala.rx v 0.3.1 I get following compile…
user4955663
  • 1,039
  • 2
  • 13
  • 21
2
votes
0 answers

How does garbage collection in regards to Ctx.Owner in scala.rx work?

I am trying to wrap my head around how exactly ownerships works in scala.rx. At the moment I have a Scala.js web application that just imports rx.Ctx.Owner.Unsafe._ wherever I am using Rxs. This - however - leads to the creation of a lot of detached…
Florian Baierl
  • 2,378
  • 3
  • 25
  • 50
2
votes
1 answer

`eventually` not found in scala.rx

Here is an example from the scala.rx doc: package tutorial.webapp import rx.core.{Rx, Var} import rx._ import rx.ops._ import scala.concurrent.Promise import scala.concurrent.duration._ import scala.scalajs.js.JSApp import…
qed
  • 22,298
  • 21
  • 125
  • 196
1
vote
0 answers

Is it harmful to throw in the subscribe onError Scala.RX an Observable?

I am using an rx.lang.scala in a for-comprehension, which i want to fail fast. I also want the resource parameters to be closed if an exception occurs. Will the doOnTerminate execute properly if you throw the Exception / Throwable, as in the example…
Stephan Hogenboom
  • 1,543
  • 2
  • 17
  • 29
1
vote
1 answer

How to obtain implicit ownerCtx: rx.Ctx.Owner in scala.rx

Here goes basic hello world example using scala.rx in version 0.3.1. It doesn't compile because of lack of implicit ownerCtx: rx.Ctx.Owner. How do I get this instance? import rx._ val a = Var(1) val b = Var(2) val c = Rx{ a() + b() } This Rx might…
pawel.panasewicz
  • 1,831
  • 16
  • 27
1
vote
1 answer

Using Timer from scala.rx

Can someone give me a simple example of using the Timer from Li Haoyi's scala.rx that doesn't depend on an Akka or any other libraries besides scalajs, dom, and rx? The example of a Timer from Haoyi's GitHub is: import…
user3025403
  • 1,070
  • 3
  • 21
  • 33
0
votes
1 answer

LinkingErrors when updating from Scala.rx 0.3.2 to 0.4.0

In my project I use Scala.rx 0.3.2. When I upgraded to version 0.4.0 - without changing any code - I suddenly get a lot of LinkingErrors for even simple code like: private val pageVisibility: Var[String] =…
Florian Baierl
  • 2,378
  • 3
  • 25
  • 50
0
votes
1 answer

Overloaded method value trigger with alternatives for '=> Unit' parameter

I just upgraded Scala.rx version 0.3.2 to 0.4.0 and suddenly I get the following errors on my triggers: overloaded method value trigger with alternatives: [error] (f: Boolean => Unit)(implicit ownerCtx: rx.Ctx.Owner)rx.Obs [error] (thunk:…
Florian Baierl
  • 2,378
  • 3
  • 25
  • 50
0
votes
1 answer

How to test `Var`s of `scala.rx` with scalatest?

I have a method which connects to a websocket and gets stream messages from some really outside system. The simplified version is: def watchOrders(): Var[Option[Order]] = { val value = Var[Option[Order]](None) // onMessage( order =>…
Freewind
  • 193,756
  • 157
  • 432
  • 708
0
votes
1 answer

Ambiguous overloading: fix it or try something else?

Background: I'm working on using scala.js/scalatags together with scala.rx. What I'm trying to achieve is binding values from html inputs to Rx Vars, using operator style. Here's what I'm up to: implicit class BoundHtmlInput(input: Input) { def…
Haspemulator
  • 11,050
  • 9
  • 49
  • 76
0
votes
1 answer

Set a limit to scala.rx timer

Here is an example using Timer from scala.rx: package tutorial.webapp import akka.actor.ActorSystem import rx.core.{Rx, Var} import rx._ import rx.ops._ import scala.concurrent.Promise import scala.concurrent.duration._ import…
qed
  • 22,298
  • 21
  • 125
  • 196