Release an image preview object URL when its owner removes it
Keep each object URL with the image preview that owns it. Release the URL when that preview is removed and its consumers no longer need it. Calling URL.revokeObjectURL() releases the object URL created by URL.createObjectURL(). Revoking a URL as soon as it is assigned can be too early if user interactions still need it. When replacing a preview, give the new preview its own URL and retire the…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.