How to use the fastdom.mutate function in fastdom

To help you get started, we’ve selected a few fastdom 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 salesforce-ux / design-system / site / assets / scripts / shared / tabs.js View on Github external
const runTabClick = (tab, otherTabs) => {
  fastdom.mutate(() => {
    forEach(otherTabs, removeActive);
    addActive(tab);
    emitter.emit('tab:select', { tab, panel: getPanel(tab) });
  });
};
github salesforce-ux / design-system / site / assets / scripts / shared / sticky.js View on Github external
setState(nextState) {
    fastdom.clear(this.layoutId);
    this.state = Object.assign({}, this.state, nextState);
    this.layoutId = fastdom.mutate(() => this.layout());
  }
github qgrid / ng2 / src / core / services / fastdom.js View on Github external
static mutate(task) {
        return FastDom.mutate(task);
    }
github qgrid / ng2 / core / services / fastdom.js View on Github external
        return Fastdom.invoke(() => fastdom.mutate(...args));
    }
github bigbluebutton / bigbluebutton / bigbluebutton-html5 / imports / ui / components / chat / message-list / component.jsx View on Github external
if (position === null) {
      fastdom.measure(() => {
        const {
          scrollHeight,
          clientHeight,
        } = scrollArea;

        fastdom.mutate(() => {
          scrollArea.scrollTop = scrollHeight - clientHeight;
        });
      });

      return;
    }

    fastdom.mutate(() => {
      scrollArea.scrollTop = position;
    });
  }
github salesforce-ux / design-system / site / assets / scripts / pages / components.js View on Github external
const updateComponentPreviewHeight = ({ flavor, height }) => {
  fastdom.mutate(() => {
    document.getElementById(`iframe-${flavor}`).height = height;
    updateScrollSpy();
  });
};
github salesforce-ux / design-system / site / assets / scripts / pages / components.js View on Github external
emitter.on('preferences:updated', () => {
        fastdom.mutate(updateScrollSpy);
      });
    },
github WorkSight / rewire / packages / rewire-grid / src / components / Row.tsx View on Github external
calculateDynamicHeight() {
    if (!isNullOrUndefined(this.props.height)) {
      return;
    }

    const components = getComponents(this.props.row);
    let   newHeight  = 0;
    fastdom.measure(() => {
      this.element.current!.style.height = 'auto';
      this.desiredHeight = this.element.current!.getBoundingClientRect().height;
      for (const component of components) {
        newHeight = Math.max(newHeight, component.desiredHeight);
      }
    });

    fastdom.mutate(() => {
      for (const component of components) {
        component.element.current!.style.height = `${newHeight}px`;
      }
    });
  }
github salesforce-ux / design-system / site / assets / scripts / shared / shapes.js View on Github external
setState(nextState) {
    fastdom.clear(this.layoutId);
    this.state = Object.assign({}, this.state, nextState);
    this.layoutId = fastdom.mutate(() => this.layout());
  }

fastdom

Eliminates layout thrashing by batching DOM read/write operations

MIT
Latest version published 9 months ago

Package Health Score

64 / 100
Full package analysis

Similar packages