spring-attic / reactor-core-js

The Reactive-Streams based implementation of Reactor-Core in Javascript
Apache License 2.0
51 stars 9 forks source link

Flux.interval doesn't work #2

Closed tsachev closed 6 years ago

tsachev commented 6 years ago

I am trying to use Flux.interval to produce events on specified interval, but it does not seem to work.

examples/reactor-core-js-interval » cat package.json
{
  "name": "reactor-core-js-interval",
  "main": "index.js",
  "dependencies": {
    "reactor-core-js": "^0.5.0"
  }
}
examples/reactor-core-js-interval » cat index.js
const reactor = require('reactor-core-js/flux');

reactor.Flux
  .interval(1000, 1000)
  .consume(v => console.log(v));

examples/reactor-core-js-interval » node index.js
0
TypeError: this._task is not a function
    at Timeout.run [as _onTimeout] (/home/tsachev/git/reactor-core-clj/examples/reactor-core-js-interval/node_modules/reactor-core-js/scheduler.js:259:12)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
/home/tsachev/git/reactor-core-clj/examples/reactor-core-js-interval/node_modules/reactor-core-js/scheduler.js:262
      this.dispose();
           ^

TypeError: this.dispose is not a function
    at Timeout.run [as _onTimeout] (/home/tsachev/git/reactor-core-clj/examples/reactor-core-js-interval/node_modules/reactor-core-js/scheduler.js:262:12)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
examples/reactor-core-js-interval »