     # keep track for disposing them later: off/on
     requestsWS: null
     responseTimesWS: null
+  demos: {}
   uiRoot: null
 
 logWith = (label) ->


init_ui = ->
  component = R.div {},
    RequestsWidget({})

  app.uiRoot = React.renderComponent(component, document.getElementById('app'));


  sub.subscribe(log)
  sub.onNext(4)

app.demos.behaviours = () ->
  sub = new Rx.BehaviorSubject(42)
  # same as `sub = new Rx.ReplaySubject(1); sub.onNext(42)`
  sub.onNext(2)
  sub.onNext(3)
  sub.subscribe(log)
  sub.onNext(4)

app.demos.backpressure = () ->
  source = Observable.range(0, 10).timeInterval().controlled()
  source.subscribe(logWith("controlled:"))
  source.request(4)
  source.request(4)

onload = ->
  init_ui()
  app.demos.mouseMove()
  init_websockets()
  #log("--")
  #app.demos.behaviours()
  #app.demos.replay()
  #app.demos.backpressures()
  #app.demos.timer()
  #app.demos.toAsync()
#
window.addEventListener("load", onload, false)
