Is there a way to cancel or override a jsonrpc call?

126 Views Asked by At

I'm using Polkadot.js in my project, and I have a function where user click to filter assets by categories. The issue is if the user click very fast, two rpc calls will be dispatched, instead of the later call overriding the first call, this will result in getting duplicate results.

Is there any way I can either cancel the first inflight rpc call, or let the second call overrides the first one? They share the same method name and the later one will have a higher id.

enter image description here

Any suggestions or help is much appreciated!

0

There are 0 best solutions below