and have a toast appear for a time, then disappear and everything gets garbage collected. I do not end up with a sitting in my DOM forever. However
var toast;
...
toast = showToast(...);
should give me an object that I can show/hide over and over. I think this implies that a showToast-created toast should insert/remove itself from the DOM as it's shown/hidden. What about a toast that is naturally in the DOM? It seems like it shouldn't pop in and out of the DOM on show/hide since the DOM may be the only reference to it.
With the
showToast
API, I should be able to doand have a toast appear for a time, then disappear and everything gets garbage collected. I do not end up with a sitting in my DOM forever. However
should give me an object that I can show/hide over and over. I think this implies that a showToast-created toast should insert/remove itself from the DOM as it's shown/hidden. What about a toast that is naturally in the DOM? It seems like it shouldn't pop in and out of the DOM on show/hide since the DOM may be the only reference to it.