How to use the somedom.view function in somedom

To help you get started, we’ve selected a few somedom 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 tacoss / testcafe-blink-diff / src / modal.js View on Github external
}
  }

  function addOverlay() {
    return mountOverlay(document.querySelector('.overlay'));
  }

  function syncOverlay() {
    if (overlay) {
      overlay.update();
    }
  }

  window.addEventListener('keyup', testKeys);

  const app = view(({ key, diff }) => ['.noop.modal', { onclick: closeModal }, [
    ['.container', { style: `width:${images[key].width}px;height:${images[key].height}px`, onupdate: syncOverlay },
      (diff
        ? [
          ['img', { src: images[key].images.out }],
        ] : [
          ['.layer', [
            ['img.a', { src: images[key].images.actual }],
          ]],
          ['.layer.overlay', [
            ['img.b', { src: images[key].images.base }],
          ]],
        ])
        .concat([
          ['button.close', { onclick: () => closeModal() }, '×'],
        ]),
    ],

somedom

Building blocks for the DOM.

MIT
Latest version published 1 year ago

Package Health Score

46 / 100
Full package analysis