Dispose example

If you remove a widget from the DOM, it won't be disposed because you might want to append it to another node. If you want to actually dispose of a widget, call dispose() on it. dispose() is safe and won't release resources if they're still used by other widgets.
If you want to dispose of everything, call dispose() on the overlay.

The following example allows you to create and dispose of widgets using the same assets. Below, you can see the number of references to each asset. A red message will appear when an asset is actually disposed. The number of skeleton references is at minimum 1 because there's a skeleton on the bottom of the page the use the same skeleton file.