RxJS - Returns the subject with the value

I've created a authentication service which components can subscribe to permission changes (login/logout/role change ,etc). In isAuthenticated function, I'm returning a subject. The problem is that I want to return the subject with a value (like Obse

Process data based on multiple observables

I have two observables from two differents HTTP calls. In my component, I need to call those two services, process the data returned from these services and send two other variable that are the result of the proccessing to the template. I have tried

Angular2: Updating the user interface after sending an API call

I'm building a UI with Angular (2) and I need the project details view to make a call to the API to get the latest data for the project every time the user interacts with the UI. I.e. when deleting a task or marking a task as done for a project (with

RxJS: How to issue original values, then reduce to the end?

I would like to emit all original values from an RxJS stream, and then emit a summary upon completion. Reduce stops the original values from emitting. Scan emits each total rather than the original values. Here is my hacky solution: let total = { tot

observable list angular 2

I'm new to Rx and have problems to get what i want. please help: i want to get a list of User Profiles Ids for a List of UserIds I have a problem merging all the results to one Observable getListOfUsers(): Observable< Profile[]> { let users = this.a

Angular2 Rollupjs

I am trying to bundle my Angular2 app using RollupJS but I have been running into a few issues: The css file referenced by my AppComponent couldn't be found and throws an error. Error transforming /demo-app.ts with 'angular' plugin: ENOENT: no such f

How to import `Observable` from` Rx` (non-angular)

I'm using SystemJS to load my es2015 project into the browser. This is what I did import {Observable} from 'rxjs/Rx'; const button = document.querySelector('button'); const start$ = Observable.fromEvent(button, 'click'); In this case Observable is un

Load the data before initializing the component - angular 2

My App.component which calls a init method in my user service. ngOnInit(){ this.init(true).then(data => { console.log("OnInit Called") }) } User.service returns a promise which in turn calls the account.init init = (isRegistered) => { retu

Observable.onSubscribe equivalent in RxJs

In RxJava, there is Observable.OnSubscribe which will call your action when something subscribes to the observable. Is there an equivalent in RxJs? It seems as though they've taken the page down since asking this question. Google's cached version liv

Angular 2 - Subscription 2 at the same time

I have the following code: //Subscription 3: role ID to role Name af.database.object('/roles/'+businessRole.$value) .subscribe((roleData) => { //Subscription 4: Get user info af.database.object('/users/'+businessRole.$key).subscribe(user => { Which

Angular 2 trying to implement observables in services

Im trying to send data from one component to other using observable. Here I'm implementing observable in service like this... import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/RX' @Injectable() export class SelectedItemServ

Angular 2 - Act on two BehaviorSubject / Observables

Suppose I have a component which needs two observables to render its content: this.manifest.subscribe((a) => { f(a, b) }) this.route.params.subscribe((b) => { f(a, b) }) What is the proper Angular / rxjs way to call f() once a arrives, and / or call

Rxjs: query the data until the predicate is satisfied

import {Observable} from '@reactivex/rxjs' // This is a fake API polling, this data is in reality coming from // the server const fakePoll$ = Observable.from([ { status: 'initialized', data: {...}, }, { status: 'progress', data: {...}, }, { status: '

SwitchMap vs MergeMap in the #ngrx example

Below is code from the Ngrx example: https://github.com/ngrx/example-app/blob/master/src/effects/book.ts My question is why in the first @Effect, it uses switchMap while the others use mergeMap. Is that because the first @Effect is dealing with netwo

RxJS Angular2 manipulating 404 in Observable.forkjoin

I'm currently chaining a bunch of http requests, however I am having trouble handling 404 errors before subscribing. My code: in template: ... service.getData().subscribe( data => this.items = data, err => console.log(err), () => console.log(&quo

stamped withLatestFrom

I need something similar to withLatestFrom which corresponds to a diagram below: ---------A-----------------B-- -1-2-3------4------5-6-7-8---- --------[A,[123]]---------------[B,[45678]] Is there any way to implement such behavior with RxJS?I apologi

Observable sequence of random numbers in a range

How can i create an observable sequence of random numbers within a range using the rxjs observable? I can iterate over a range using range. For example: Observable.range(0, 20) .flatMap(data => getImage(data)) .map(data => this.image = data); Howeve

Array flows in an array of stream operators

In Rx.js, how to turn a stream of arrays into array of streams for example i have a stream of following:['0a','0b'], ['1a','1b'],['2a','2b','2c'] and i want to get the following streams: 0a---1a---2a---> 0b---1b---2b---> 2c---> Are there any oper

Removing Object.observe and RxJS and Angular 2

I am a bit confused, because Obejct.observe is said to be withdrawn from the ES2016. On the other hand there were talks on Angular Connect that mentions they will rely on it. So as far I understand Angular 2 doesn't rely on Object.observe directly bu

How to buffer a stream using the topic fromWebSocket

This RxJava buffer example (with marble chart!) describes the desired result perfectly: collect items in buffers during the bursty periods and emit them at the end of each burst, by using the debounce operator to emit a buffer closing indicator to th

How do feeds fit into a feed application?

I have a webapp which prints the output of a command line program running on the sever. This output is sent using RxJS streams (source). I was trying to refactor this app with Flux architecture (from ReactJS people) which enforces the app flow in a s