This example demonstrates a custom CommandHandler. It uses localStorage as the repository for the clipboard, rather than an in-memory global variable. It is defined in its own file, as LocalStorageCommandHandler.ts.

Try copying and pasting between the above Diagrams, or between tabs/windows that contain Diagrams using LocalStorageCommandHandler. Note that when copying and pasting between Diagrams, it will work best if they have similar templates.