switch filter to Subject from BehaviorSubject
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user