mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
add comment to this.zone.runOutsideAngular
This commit is contained in:
@@ -148,6 +148,13 @@ export class RequestService {
|
|||||||
* @param {RestRequest} request The request to send out
|
* @param {RestRequest} request The request to send out
|
||||||
*/
|
*/
|
||||||
configure<T extends CacheableObject>(request: RestRequest): void {
|
configure<T extends CacheableObject>(request: RestRequest): void {
|
||||||
|
/**
|
||||||
|
* Since this method doesn't return anything, is used very often and has
|
||||||
|
* problems with actions being dispatched to the store but not reduced before
|
||||||
|
* that info is needed again, we may as well run it in a separate zone. That way
|
||||||
|
* it won't block the UI, and actions have a better chance of being already
|
||||||
|
* processed when the next isCachedOrPending call comes
|
||||||
|
*/
|
||||||
this.zone.runOutsideAngular(() => {
|
this.zone.runOutsideAngular(() => {
|
||||||
const isGetRequest = request.method === RestRequestMethod.GET;
|
const isGetRequest = request.method === RestRequestMethod.GET;
|
||||||
if (!isGetRequest || request.forceBypassCache || !this.isCachedOrPending(request)) {
|
if (!isGetRequest || request.forceBypassCache || !this.isCachedOrPending(request)) {
|
||||||
|
Reference in New Issue
Block a user