Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rxjs]

The Reactive Extensions for JavaScript (RxJS) is a set of libraries for composing asynchronous and event-based programs.

1
vote
0answers
28 views

RxJS BehaviorSubject with asynchronous initial value

I am using RxJS to fetch a data structure from a server and cache it, but I also need to be able to overwrite the value locally (specifically, a user operation can change the server state, and the ...
1
vote
0answers
8 views

RXJS and Ionic- Sequencial Subscriptions Waiting on User Action

In an Ionic App a user can open a new browser via "inAppBrowser". I'm trying to get the stats of the user before they go into to the inAppBrowser, get the stats again when browser closes, and then run ...
1
vote
0answers
20 views

Angular Websocket service with wait for response sending

I am writing an Angular Websocket service that can send messages to a server and then can subscribe to the response. I am grateful for every suggestion to improve this. ...
2
votes
0answers
29 views

Caching different http-requests

There have been multiple discussions on caching http-requests with RXJS. In this question/proposal I want to propose a custom rxjs-operator (non-pure) to provide ...
0
votes
0answers
21 views

Parse json data for forms

I have this form who get all the data from json, and serialized it to make it fill in the UI of material. I was thinking about making a class and name it parses who parse all the data for the ...
3
votes
0answers
98 views

Fetching user information along with user posts in Angular

Here is my code with 2 services, one is messageService which is used to get user messages: ...
2
votes
1answer
75 views

List component using RXJS Angular

I have a small angular project, where I have an Article component to list articles with pagination system. The default page The placeholder loader page The main objectives are: Display the ...
1
vote
0answers
18 views

Angular2 “Logged In State Watcher”

I have a small website I'm working on as a hobby and I created a login page/home page so far. I wanted to get the basic login/logout functionality going before filling out the main part of my site. ...
2
votes
0answers
1k views

Angular async pipe with loading spinner and manual refresh

I have an Angular 6 app with the following requirements: Get data from a web service. Load the data when the page is displayed. Reload the data when the user requests a reload by through some UI, ...
2
votes
1answer
57 views

JavaScript and RxJS Password Strength Indicator

This is my first time using RxJS (or any observable library). It seems to work okay but I'm not sure about best practices. The thing that I am most unsure about is subscribing to the observable ...
3
votes
1answer
235 views

Using RxJS Observables to mediate routes in nodejs

I am learning to be a full stack developer and have been building out an application using Node JS as a backend. Since I have lots of experience using Angular I love RxJS. So naturally I was tempted ...
0
votes
0answers
35 views

Angular2 and RxJS passing objects around with a service

Let's say I want to share an object between multiple components. This service will allow components to send or receive the object. This functionality allows for an object to be Globally Accessible. ...
2
votes
0answers
990 views

RXJS queue up multiple http requests and send when x conditions happens

Just started to use rxjs few weeks ago, I think I'm getting most of it right, but my code seems to be not that efficient and prone to bugs I haven't run into yet! I need to be able to send http ...
2
votes
2answers
79 views

Counting quiz for children

I made a game for children. This game tests the ability to count (i.e. compare numbers based on magnitude). First you must select the age of the child in the upper menu, then you need to select blocks ...
1
vote
1answer
37 views

Logging observable values while extending service

I'm trying to extend a service function which returns an Observable<T>. The idea is to extend the function so I can add logging functionality whenever the ...
2
votes
1answer
83 views

Store first value of http request with rxjs but keep doing httprequest

With RXJS library : I need to store values from the FIRST http request, but keep doing other http request on demand. I have done this code so far, and that is working. But I think there is a more ...
1
vote
1answer
187 views

Changing http-requests conditionally

I'm new to RXJS and I have a working piece of code for http-request and subscribing to Observables from a shared service in Angular. This works, but I'd want to get rid of the nested subscriptions, ...
0
votes
2answers
721 views

Angular2/4 broadcast service using RxJS

I am no expert in RxJS as I am still learning my way around the new paradigm of Observable/Subject. I was trying to implement a broadcast service (based on NgRadio) that allows a new subscriber to ...
3
votes
1answer
2k views

Chaining 3 dependent HTTP request subscriptions one, which is polling

Here is a function that triggers after selecting from a dropdown to choose the floor. As you can see, there are 3 levels of API calls (regular HTTP GET requests with JSON responses) that chain ...
4
votes
1answer
7k views

RxJS Observable with initial value

Is it possible to get rid of the BehaviourSubject to have an Observable with an initial value? Another thing I don't like is that I'm using getValue() and then modify this value and push it with next ...
1
vote
1answer
3k views

Angular 2 / rxjs chaining HTTP calls

I have a registration form. Step 1 user creates an account. As user creates an account I need to authenticate user with the created account. in my account.service.ts I have following. Is this the ...
8
votes
1answer
19k views

Angular 2 clock with RxJS Observable

I'm fairly new to Angular 2 and I started off with creating a clock for my app. I tried to stick to the official documentation tutorial. Folder structure: The CSS file is still empty and the HTML is ...
4
votes
0answers
517 views

Wrapping IndexDB with RxJs

I find IndexedDB cumbersome and want to wrap the functionality with rxjs observables. I've come up with an angular2 service that seems to fit the bill, but I'm wondering if I'm using the observables ...
2
votes
1answer
4k views

switchMap with array of Observables

I'm trying Rxjs 5 to simplify some Node.js nested callbacks. I need to read a directory (fs.readdir), then read stats of each file (fs.stats) and parse them if they were modified since last sync. The ...
3
votes
0answers
83 views

Angular 2 tagging module with RxJS

I'm currently developing a small Angular tagging module which will enable me to populate an array from a text input, pretty much like Selectize to give an example. I'm using a BehaviorSubject and ...
3
votes
0answers
58 views

Slack bot for miming similar messages

I have a Slack bot that takes a stream of messages and the idea is that if 3 different users repeat the same message, the bot will also mime that message. I am just beginning with RXJS and I am ...
1
vote
1answer
3k views

Call multiple services from angular2 component

This is my first Angular2 component, which makes two api calls: the first call provide the input for the the second one. The following is my attempt at this code. ...
2
votes
1answer
81 views

Improving observable persistent queue mini-library

I am creating a small backend library that uses a persistent queue, where the queue is just lines in a text file. The purpose is simply to allow multiple processes to read from the text file, so that ...
2
votes
0answers
298 views

Wrapping MongoDB Call Results in Observables

I have a number of functions that follow the basic pattern below. The intent is to provide a MongoDB implementation for a storage interface in a TypeScript application. Is there a better way to ...
1
vote
0answers
58 views

REST request using reactive programming

The following code is an extract of a small library I wrote. Full code is available here. My question is about the following function. I added comments on each state. I'm wondering if I could do ...
1
vote
0answers
31 views

Run code after making a certain number of requests using RxJS

I'm experimenting with reactive JS by writing mocha tests. I wrote a test that makes a certain number of requests to an API before stopping. However, this being my first experience with RxJS, I don't ...
1
vote
0answers
98 views

File upload with Node streams

I'm implementing a file upload using NodeJS. I've got fully functional code, however, it feels overly complicated and I'm hoping there would be an easier way to implement the same thing? In ...
2
votes
1answer
70 views

ReactiveX observable that uses another observable

I am trying to write an Angular service that will wrap the regular Http service and automatically make authentication calls if Bearer token is not available or invalid. Here's an illustration of a ...
5
votes
1answer
146 views

Video downloader app implemented in RxJs

I have used multiple map/flatmap combinations. Could anybody help me with the review? ...