The cancel() method of the ReadableStream interface returns a Promise that resolves when the stream is canceled.
cancel()
MDN Reference