How to use the @lumino/virtualdom.VirtualDOM.realize function in @lumino/virtualdom

To help you get started, we’ve selected a few @lumino/virtualdom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / tests / test-apputils / src / commandlinker.spec.ts View on Github external
let called = false;
        const command = 'commandlinker:connect-node';
        const commands = new CommandRegistry();
        const linker = new CommandLinker({ commands });
        let node: HTMLElement;
        let vnode: VirtualNode;
        const disposable = commands.addCommand(command, {
          execute: () => {
            called = true;
          }
        });

        vnode = h.div({
          dataset: linker.populateVNodeDataset(command, undefined)
        });
        node = VirtualDOM.realize(vnode);
        document.body.appendChild(node);

        expect(called).to.equal(false);
        simulate(node, 'click');
        expect(called).to.equal(true);

        document.body.removeChild(node);
        linker.dispose();
        disposable.dispose();
      });
    });

@lumino/virtualdom

Lumino Virtual DOM

BSD-3-Clause
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis

Similar packages