Skip to content

Commit

Permalink
added exhaustAll
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanank committed Oct 3, 2023
1 parent 4913b51 commit 611c20e
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2888,10 +2888,36 @@ export class App implements OnInit {
bootstrapApplication(App);
```

**exhaustAll** -
**exhaustAll** - Converts a higher-order Observable into a first-order Observable by dropping inner Observables while the previous inner Observable has not yet completed.

```typescript
import 'zone.js/dist/zone';
import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { bootstrapApplication } from '@angular/platform-browser';
import { fromEvent, map, interval, take, exhaustAll } from 'rxjs';

@Component({
selector: 'my-app',
standalone: true,
imports: [CommonModule],
template: `
<h1>exhaustAll Example</h1>
`,
})
export class App implements OnInit {

ngOnInit() {
const clicks = fromEvent(document, 'click');
const higherOrder = clicks.pipe(
map(() => interval(1000).pipe(take(5)))
);
const result = higherOrder.pipe(exhaustAll());
result.subscribe(x => console.log(x));
}
}

bootstrapApplication(App);
```

**mergeAll** -
Expand Down

0 comments on commit 611c20e

Please sign in to comment.