Questions tagged [rxjs5]

The 5th version of the reactive extensions for javascript.

This tag is for questions regarding the 5th version of the ReactiveX framework for the JavaScript language.

Basics

RxJS is a framework for Observables. Observables are similar to Promises, in that they represent data, that may not jet be available. The difference is, that Observables can get multiple results (they are said to observe multiple events). These events could be anything, like clicks on a button, or network requests.

RxJS

rxjs provides an API for working with Observables in JavaScript. It has many methods, that allow modifying Observables, similar to how map(), filter() and reduce() work on ES6 Arrays.

Links

Before asking an rxjs5 question here on StackOverflow, please make sure to read the official documentation.

1510 questions
8
votes
7 answers

How to convert node readable stream to RX observable

If I have a Node js stream, say for example from something like process.stdin or from fs.createReadStream, how can I convert this to be an RxJs Observable stream using RxJs5? I see that RxJs-Node has a fromReadableStream method, but that looks like…
JuanCaicedo
  • 3,132
  • 2
  • 14
  • 36
8
votes
1 answer

ValueChanges stops working as soon as an error occurs in an Rx.Observable

I am following some Rx.Observable tutorials from an Angular 2 application and using an AutoComplete style of system. As I type into a field, the valueChanges event fires from the Angular 2 FormControl. This is chained through to Observable that is…
David Cruwys
  • 6,262
  • 12
  • 45
  • 91
8
votes
2 answers

SystemJS loads many files for rxjs

I have the following systemjs.config.js (based on some example I found on the internet): (function (global) { System.config({ paths: { // paths serve as alias 'js:': 'js/', }, // map tells the…
Robert Hegner
  • 9,014
  • 7
  • 62
  • 98
8
votes
1 answer

How do you use Observable.bindCallback()

How do I use Observable.bindCallback() with a callback that returns 2 args, callback(results, status)? The example is with google.maps.places API below: const service = new google.maps.places.PlacesService(map); // service.nearbySearch(request,…
michael
  • 4,377
  • 8
  • 47
  • 73
8
votes
1 answer

ngrx: Supplied parameters do not match any signature of call target

I am using ngrx/effects. After updating rxjs from 5.0.0-beta.12 to 5.0.0-rc.1, my IDE WebStorm gives me the error below (red underline). And when I run my app, the same error also shows in the terminal. Supplied parameters do not match any…
Hongbo Miao
  • 45,290
  • 60
  • 174
  • 267
8
votes
4 answers

Unit Test RxJS Observable.timer using typescript, karma and jasmine

Hi I'm relatively new to Angular2, Karma and Jasmine. Currently I'm using Angular 2 RC4 Jasmine 2.4.x I have an Angular 2 service which periodically calls an http service like this: getDataFromDb() { return Observable.timer(0, 2000).flatMap(() =>…
stevehin
  • 93
  • 1
  • 1
  • 4
8
votes
2 answers

Angular2: How to import rx-dom

I want to use DOM in angular project like this Rx.DOM.jsonpRequest but DOM is not available on Rx which Im importing like this import Rx = require('rxjs'); I also tried to import rxjs dom but error was can not find module, I installed rxjs-dom…
blackHawk
  • 6,047
  • 13
  • 57
  • 100
8
votes
1 answer

RxJs / Typescript throws 'property clientX does not exist on type {}'

I am trying to do something very simple, just log the event.clientX on mouseover, and this is the module code: import { Observable, Subject } from 'rxjs'; import StarSky from './starsky'; import constants from '../constants/index'; const HERO_Y =…
Maciej Sitko
  • 416
  • 3
  • 13
8
votes
3 answers

Observable errors with Angular2 beta.12 and RxJs 5 beta.3

Hello, I am using Angular2 beta 12 running in VS2015. When I update to rxjs from 5.0.0-beta.2 to beta.3 I encounter a range of exceptions generally relating to my promises. E.g. Property map does not exist on type Observable Property…
DanAbdn
  • 7,151
  • 7
  • 27
  • 38
8
votes
2 answers

Angular2: How to subscribe to Http.post observable inside a service and a component properly?

For a JWT authentification, I make a post request to get the token using the new Http module working with Observables now. I have a simple Login component showing the form: @Component({ selector: 'my-login', template: `
bertrandg
  • 3,147
  • 2
  • 27
  • 35
8
votes
4 answers

RxJS 5.0 "do while" like mechanism

I'm trying to use RxJS for a simple short poll. It needs to make a request once every delay seconds to the location path on the server, ending once one of two conditions are reached: either the callback isComplete(data) returns true or it has tried…
Colton Voege
  • 123
  • 1
  • 5
7
votes
2 answers

Hasty forkjoin alternative rxjs for observable chaining?

I have 5 different API calls to make, and they all are chained right now in forkJoin. My new requirement is the subscribe should fire anytime any new observable solves. Is there any operator or any other trick in rxjs where I can keep the chaining…
Aijaz
  • 680
  • 15
  • 42
7
votes
2 answers

Should I use multiple BehaviorSubject for different subscriptions?

I have some sibling components and a DataService in my Angular (v7) project and I call methods as the following scenario: TicketComponent adds ticket and calls reloadTickets method in TicketListComponent and similarly FileComponent adds file and…
Jack
  • 1
  • 21
  • 118
  • 236
7
votes
1 answer

usng rxjs-5-to-6-migrate correctly. issues with tsconfig path

The documentation to use rxjs-5-to-6-migrate states the following: To refactor TypeScript code so that it doesn't depend on rxjs-compat, you can use rxjs-tslint. npm i -g rxjs-tslint rxjs-5-to-6-migrate -p [path/to/tsconfig.json] So I did that…
weridpotato
  • 261
  • 1
  • 3
  • 11
7
votes
1 answer

Create classes for Single, Maybe and Completable in RxJS 6

It's a good practice to create my own Observable extended classes? i want to implement my own Single and Completable classes for the sake of know the amount or absence of data than and observable can return and i want it as a class because i use…