Skip to content

Commit

Permalink
Merge pull request #12 from manthanank:new-changes
Browse files Browse the repository at this point in the history
feat: updated readme
  • Loading branch information
manthanank authored Jul 5, 2023
2 parents 7ee48bf + 0dfa29e commit 17da2d4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,33 @@ export class App implements OnInit {
bootstrapApplication(App);
```

**mergeMapTo** -
**mergeMapTo** - Projects each source value to the same Observable which is merged multiple times in the output Observable.

```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, mergeMapTo, interval } from 'rxjs';

@Component({
selector: 'my-app',
standalone: true,
imports: [CommonModule],
template: `
<h1>mergeMapTo operator</h1>
`,
})
export class App implements OnInit {
ngOnInit() {
const clicks = fromEvent(document, 'click');
const result = clicks.pipe(mergeMapTo(interval(1000)));

result.subscribe(x => console.log(x));
}
}

bootstrapApplication(App);
```

**mergeScan** -
Expand Down

0 comments on commit 17da2d4

Please sign in to comment.