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
0
votes
1 answer

when using Observable.fromEvent() bufferTime() take(3) and subscribe() - error "Cannot read property 'splice' of null" after last event is emitted

var source = Observable.fromEvent(document.body, 'keypress'); var obs = source .bufferTime(1000) .map((clickBuffer) => { console.log(clickBuffer) return clickBuffer.length; }) .take(3) ; // when using this function - error…
Dariux
  • 3,953
  • 9
  • 43
  • 69
0
votes
2 answers

How to fire .next() for the second time in rxjs async subject?

I have a component which has two buttons.when i click on the first button as per the demo in the given plunker below it emits an event and my service function emits an async subject with some values...When i click on another button i am trying to…
Raja Reddy
  • 417
  • 2
  • 5
  • 11
0
votes
1 answer

How to use RxJS 5 buffer function?

I googled a lot, tried to look at d.ts file but still cannot understand what is wrong. Cannot find example of RxJs5 how to use this function. var source = Observable.fromEvent(document.body, 'keypress'); var delayedSource =…
Dariux
  • 3,953
  • 9
  • 43
  • 69
0
votes
1 answer

How to use an observable result and then return the observable

using Rxjs I need to do 4 actions in an Angular service and then the component consumes that service function: -call the function "ensureHasCache():Observable" -call the function "create():Observable" -take the result of create() and assign a local…
user3471528
  • 3,013
  • 6
  • 36
  • 60
0
votes
1 answer

Did not execute the stream which subscribed by another subject

code here: @Injectable() export class ProjectService { create$: Rx.Subject = new Rx.Subject(); _create: Rx.Observable = this.create$.asObservable(); newProject: Rx.Subject = new Rx.Subject(); get$:…
VincentGuo
  • 247
  • 2
  • 9
0
votes
1 answer

angular2: Obserable response.json() after all subscribes are done

I have a class which extends angular Http class, let's call it MyHttp. I also have MyJwtHttp class which extends MyHttp class. I want to be able to return the response as json the problem is that if I'm doing something like…
tubu13
  • 924
  • 2
  • 17
  • 34
0
votes
2 answers

Convert Subject to Observable

I want to run this example with rxjs5. But it doesn't work. I've stucked on #41 line. It says that map returns Subject and it doesn't have .takeUntil method. What is the best way to implement it? Thanks
0
votes
1 answer

Is there a way to user pairs for Rxjs5?

Can not find Rx.Observable.pairs in Rxjs5, what I need just convert an object into Observable and inspect the change for each property. any ideas? var a = { aa: "aa", bb: "bb" }; function pairs(obj) { // List of object's key-value pairs …
VincentGuo
  • 247
  • 2
  • 9
0
votes
1 answer

Can't create 2 independent Observables with forkJoin

I have a function that takes a ID as parameter and makes HTTP calls, depending on the ID. It returns a Observable. I expected the calls with different parameters to be completely independent, but they influence each other. I use RxJS…
Manuel Huber
  • 121
  • 2
  • 14
0
votes
1 answer

How to cleanly architect downstream subscribers that call an upstream reload in RxJS?

Trying to construct a schedule using RxJS v5, where certain events can trigger the schedule to reload. Currently using 3 sources - schedule$, event$, and userNotification$ (example below). I've tried a number of different strategies and I'm…
Adam
  • 2,873
  • 3
  • 18
  • 17
0
votes
2 answers

Timestamp in RxJS 5.0

In RxJS 4.0 I could do something as follows: let clicks = Observable.fromEvent(board.canvas, 'click'), keydowns = Observable.fromEvent(document, 'keydown') .filter((e) => e.keyCode === 32); return Observable .merge(clicks, keydowns) …
Claudiordgz
  • 3,023
  • 1
  • 21
  • 48
0
votes
1 answer

Error in argument of parstInt and isNaN function

Why there is error when im passing argument in the parstInt and isNaN function saying argument of type void is not assignable to type string how can i solve this var u = rx.Observable.interval(400).take(6).map((i)=>{ ['2', 'sdf', '4', '8fj',…
blackHawk
  • 6,047
  • 13
  • 57
  • 100
0
votes
1 answer

Indicate an array contains certain types at certain indexes?

I'm working with a Typescript Angular2 site that uses RxJS Observables. I am taking a piece of user data and hitting two different API endpoints. I'm .forkJoining them together like so var First: TypeA = this.api.FirstEndpoint(...); var Second:…
Corey Ogburn
  • 24,072
  • 31
  • 113
  • 188
0
votes
2 answers

rxjs with angular2: into component class how to convert input field data changes to rxjs stream

Its said that we can convert anything into stream using rxjs, here i want to convert the data coming from input field into stream and later subscribe to it, there is method in angular2 for this using valueChanges…
blackHawk
  • 6,047
  • 13
  • 57
  • 100
0
votes
1 answer

How to chain RxJS5 operators into a new operator?

According to the operator creation guide, i tried to chain some operators i used to an another operator but without any success. function mySimpleOperator(actionName, iterable$, functionThatReturnAnObservable) { return…
Koalabz
  • 13
  • 5
1 2 3
99
100