hot stream
This commit is contained in:
parent
2622f9c6c3
commit
31e97032c4
@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
|
|||||||
import { Employee } from 'src/typings';
|
import { Employee } from 'src/typings';
|
||||||
import { EmployeesService } from 'src/app/api/employees.service';
|
import { EmployeesService } from 'src/app/api/employees.service';
|
||||||
import { Subscription, pipe, Observable } from 'rxjs';
|
import { Subscription, pipe, Observable } from 'rxjs';
|
||||||
import { startWith } from 'rxjs/operators';
|
import { startWith, share } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ip-employee-container',
|
selector: 'ip-employee-container',
|
||||||
@ -11,7 +11,10 @@ import { startWith } from 'rxjs/operators';
|
|||||||
})
|
})
|
||||||
export class EmployeeContainerComponent {
|
export class EmployeeContainerComponent {
|
||||||
|
|
||||||
employees$ = this.employeesService.getEmployees();
|
employees$ = this.employeesService.getEmployees().pipe(
|
||||||
|
share(),
|
||||||
|
// shareReplay
|
||||||
|
);
|
||||||
|
|
||||||
// employees: Employee[];
|
// employees: Employee[];
|
||||||
// private subscription: Subscription;
|
// private subscription: Subscription;
|
||||||
|
Loading…
Reference in New Issue
Block a user