Cancel Token on reader promise


I need to know if we can cancel the reader promise of loading data, like we can do it in axios for example.

I want to use the Debounce functionnality to just execute the last loading data promise from a consecutif loading data promises, in order to do that I would need to know how we can cancel promises in vtk.js?

Thank you

There currently is no way to abort a fetch request. An AbortController would need to be added to the reader.

If you’re using macro.debounce from vtk.js, then it will wait X milliseconds from the last request before executing your method. If you’re using another debounce implementation (e.g. lodash), then you want to ensure that you execute on the trailing edge of the timeout. This sort of mimics your need to execute the last loading data promise within X milliseconds.