How to use the somedom.listeners 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
import {
  bind, view, mount, unmount, render, listeners, attributes, classes,
} from 'somedom';

export const tag = bind(render, listeners(), attributes({
  class: classes,
}));

export function mountOverlay(overlay) {
  let w;
  let h;
  let clicked;

  const slider = mount(overlay.parentNode, ['div', { class: 'slider' }], tag);

  function sync() {
    w = overlay.parentNode.offsetWidth;
    h = overlay.parentNode.offsetHeight;

    overlay.style.width = `${w / 2}px`;

somedom

Building blocks for the DOM.

MIT
Latest version published 1 year ago

Package Health Score

46 / 100
Full package analysis