Lifecycle and destroy
When Room Viewer loads, what it keeps between openings and how to remove it in a single-page app.
Room Viewer adds one dialog to your page the first time it opens. After the shopper closes it, the dialog stays in the page, hidden, with the room it loaded: reopening the same product is instant. With a script tag or JavaScript, opening another product starts a fresh viewer.
In a single-page app, remove Room Viewer when its trigger leaves the page, so a viewer from one route does not stay behind on the next.
The embed build serves the whole page: it listens to clicks on the document, so triggers added later work, and you never bind or unbind them. It stays for the life of the page.
To remove Room Viewer when a route changes, use the JavaScript package instead: new RoomViewerDialog() gives you destroy().