21,067
questions
1
vote
1
answer
15
views
why switchmap is working like that conversion observable<t> to t
I'm working on an Angular project and came across a situation where switchMap seems to convert an Observable into a boolean. Here's the code:
ngOnInit(): void {
this.hello().subscribe(...
2
votes
3
answers
30
views
How to display an Angular route config loader after a specified delay?
I want to show a loader when async loading an Angular route config, however sometimes these can load very fast and the loader just flashes on screen for a split second.
I want to instead only show the ...
1
vote
0
answers
20
views
Is not assignable to type 'IntrinsicAttributes' [closed]
I am getting an error
Type '{ key: string; icon: ForwardRefExoticComponent<Omit<LucideProps, "ref"> & RefAttributes<SVGSVGElement>>; label: string; href: string; }' is ...
0
votes
1
answer
22
views
Rxjs async queue pause and resume problem
My situation is: websocket will keep sending audio binary, I use concatMap play these binary in a async queue.
const audio = new Audio()
subject.pipe(
concatMap(v => {
return new ...
0
votes
1
answer
40
views
Optional generic select function for useObservable hook in react
I have custom generic hook for rxjs observables. Now it looks like this:
type Params<T> = {
observable$: Observable<T> | null;
next: (value: T) => void;
};
export const ...
1
vote
3
answers
67
views
Are Observables not really asynchronous?
I'm surprised by the order of the output of this Observable example:
<script type="module">
import { of } from 'https://dev.jspm.io/rxjs@6';
console.log("1. before subscribe");
of(["asd"])....
1
vote
0
answers
33
views
Angular app using electron and rxjs doesn't emits as it should
I am using Angular app with Rxjs and electron. I am creating subscription using merge
merge(entityUpdated$, timer(1 * 1000, 10)), where I am downloading updates from BE every 10seconds or when any of ...
0
votes
2
answers
33
views
Angular Behavior Subject For Login Not Working as Expected
:
I'm using RXJs Behavior Subject to add the username of logged in user on my header, when user logs in there username should appear without having to reload. In my account service I create a ...
1
vote
0
answers
34
views
Differences in Generics Between RxJS Documentation and GitHub Code
I'm reading up on RxJS and noticed that for some functions, there are differences in the documentation vs. the Github code, even though the documentation seems to be directly generated from the code.
...
0
votes
0
answers
69
views
Rxjs - Subscription next(), error(), or complete() methods of http request not triggered when request times out
In my angular + ngrx application, I have an @Effect triggered by an Action. Code is below
@Effect()
customAction$ = this._actions$.pipe(
ofType<CustomAction>(Actions.CustomAction),
tap(()...
0
votes
0
answers
36
views
Rxjs : switchMap() with combineLatest() returns only one Observable inspite of inputting multiple Observables
I try to learn Rxjs by coding below example.
example is for accessing userinfo with usage pipe operator.
const rxjs =require('rxjs');
const { Observable, fromEvent, switchMap, take, pipe, map, ...
1
vote
1
answer
51
views
BehaviorSubject does not update when called from app.config.ts
TL;DR - Solution:
I was using subscribe rather than pipe the value to the APP_INITIALIZER. Also, I was registering twice UserService, once as a singleton (which it should be) and second time within ...
1
vote
1
answer
51
views
Rxjs: Consumer observes multiple times after one next() call in React
I am casting some data from one component on button click to another. After one next call consumer fires multiple times (the number of those is also inconsistent) while I was expecting single reaction....
0
votes
0
answers
53
views
Cypress Angular Test with cy.clock and RxJS Timer Doesn't Display View Changes
I'm writing E2E tests for my Angular app using Cypress. I have a component with a toggle, and if the toggle is enabled, this subscription is created:
this._sub = timer(60000, 60000)
.pipe(
...
1
vote
2
answers
82
views
Nested *ngFor in Angular v18.2.2
I am trying to make a simple contact book to work on my skills. I have it so that contacts can have many emails. My API endpoint for contacts is http://localhost:8080/contacts and my endpoint for ...