Skip to content

Commit c90008e

Browse files
committed
Use take instead unsubscribing the observable
1 parent 6075317 commit c90008e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/shared/search/search-filters/search-filters.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import {
1919
filter,
2020
map,
21+
take,
2122
} from 'rxjs/operators';
2223

2324
import {
@@ -201,7 +202,7 @@ export class SearchFiltersComponent implements OnInit {
201202
}
202203
return result;
203204
}),
204-
).subscribe().unsubscribe(); // Execute the pipeline and immediately unsubscribe
205+
).pipe(take(1)).subscribe(); // Execute the pipeline once and complete
205206
}
206207
}
207208

0 commit comments

Comments
 (0)