mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
Use take instead unsubscribe
This commit is contained in:
@@ -2,7 +2,7 @@ import { Component, Inject, Input, OnDestroy, OnInit } from '@angular/core';
|
|||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { BehaviorSubject, Observable } from 'rxjs';
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
import { map, filter } from 'rxjs/operators';
|
import { map, filter, take } from 'rxjs/operators';
|
||||||
|
|
||||||
import { SearchService } from '../../../core/shared/search/search.service';
|
import { SearchService } from '../../../core/shared/search/search.service';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
@@ -188,7 +188,7 @@ export class SearchFiltersComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
})
|
})
|
||||||
).subscribe().unsubscribe(); // Execute the pipeline and immediately unsubscribe
|
).pipe(take(1)).subscribe(); // Execute the pipeline and immediately unsubscribe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user