troyanskiy/ngx-resource

How to cancel the request

komarovalexander opened this issue · 0 comments

Hi, which is the best way to cancel the request when you use IResourceMethodPromise?

For example, I need the result of the latest request

onEvent(event){
   this.something =  await this.resource.get(event);
}

onEvent can happen multiple times but I need previous request results to be skipped and only the latest one is applied

is there some common solution for this or should I handle this in my code?