How to use the @reactivex/rxjs.Observable.interval function in @reactivex/rxjs

To help you get started, we’ve selected a few @reactivex/rxjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kitten / fluorine / test / dispatcher / schedule.js View on Github external
test('reverts changes if an agenda fails', t => {
  const dispatcher = createDispatcher()

  dispatcher
    .reduce(AdderStore)
    .bufferCount(4)
    .subscribe(x => {
      t.same(x, [ 0, 1, 2, 0 ])
    }, err => {
      t.fail()
    }, () => {
      t.end()
    })

  dispatcher.schedule(Observable
    .interval(200)
    .take(2)
    .map(() => add)
    .concat(Observable.throw()))
})
github kitten / fluorine / test / dispatcher / schedule.js View on Github external
.subscribe(([ x, y ]) => {
      t.same(x, [ 0, 1, 2, 0 ])
      t.same(y, [ 0, -1, -2, -3, -4, -5 ])
    }, err => {
      t.fail()
    }, () => {
      t.end()
    })

  dispatcher.schedule(Observable
    .interval(250)
    .take(2)
    .map(() => add)
    .concat(Observable.throw()))

  dispatcher.schedule(Observable
    .interval(100)
    .take(5)
    .map(() => subtract))
})
github kitten / fluorine / test / dispatcher / schedule.js View on Github external
.reduce(AdderStore)
      .bufferCount(4),
    dispatcher
      .reduce(SubtractorStore)
      .bufferCount(6)
  ])
    .subscribe(([ x, y ]) => {
      t.same(x, [ 0, 1, 2, 0 ])
      t.same(y, [ 0, -1, -2, -3, -4, -5 ])
    }, err => {
      t.fail()
    }, () => {
      t.end()
    })

  dispatcher.schedule(Observable
    .interval(250)
    .take(2)
    .map(() => add)
    .concat(Observable.throw()))

  dispatcher.schedule(Observable
    .interval(100)
    .take(5)
    .map(() => subtract))
})
github krakenjs / react-redux-krakenjs-swaggerize-express / client / app / components / pet / pet.js View on Github external
componentDidMount() {
        if (this.props.photoUrls && this.props.photoUrls.length > 1) {
            this.imageToggle = Observable.interval(2000)
                .take(this.props.photoUrls.length)
                .repeat(this.props.repeatCount)
                .subscribe((x) => {
                    this.setState({
                        photoUrl: this.props.photoUrls[x]
                    });
                });
        }
    }