switch filter to Subject from BehaviorSubject

This commit is contained in:
Jesse Lucas
2020-04-03 09:20:27 -05:00
parent 915faabe25
commit 9907523321
6 changed files with 35 additions and 25 deletions
+5 -8
View File
@@ -1,29 +1,26 @@
import { Injectable } from '@angular/core';
import { StType } from '../type';
import { BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
import { Subject } from 'rxjs';
export interface FilterInput {
type: StType;
text: string
}
@Injectable({
providedIn: 'root'
})
export class FilterService {
previousInputs = new Map<StType, string>(
[
[StType.Folder, ""],
[StType.Device, ""],
]
)
constructor() { }
private filterChangeSource = new BehaviorSubject<FilterInput>({ type: StType.Folder, text: "" });
private filterChangeSource = new Subject<FilterInput>();
filterChanged$ = this.filterChangeSource.asObservable();
changeFilter(input: FilterInput) {