I am updating a lot of records under @ngrx/data, which calls a remote API in the background to sync the database and the local store.
dataList.forEach((entity) => {
const p = this.entitySvc
.getEntityCollectionService(storeName)
.upsert(entity)
.toPromise();
promises.push(p);
});
return Promise.all(promises);
The issue I have is that the remote API call happens outside of my code, and it happens so fast the connections overwhelm the browser with:
net::ERR_INSUFFICIENT_RESOURCES
Throttling the code above doesn't help because the remote API calls happen outside of my control.
I there a way to throttle the ngrx/data remote API calls, or another way to address this issue?