How to use the fastdom.write 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 zetter / react-crossword / src / javascripts / crosswords / crossword.js View on Github external
fastdom.read(() => {
        // Our grid is a square, set the height of the grid wrapper
        // to the width of the grid wrapper
        fastdom.write(() => {
          this.$gridWrapper.css(
            'height',
            `${this.$gridWrapper.offset().width}px`,
          );
        });
        this.gridHeightIsSet = true;
      });
    } else if (this.gridHeightIsSet) {
github bmcmahen / cast / index.js View on Github external
Cast.prototype.renderNew = function(block){
  this.emit('render', block)
  fastdom.write(function(){
    this.el.appendChild(block.el);
  }.bind(this));
  fastdom.defer(block.show.bind(block));
};
github bmcmahen / cast / block.js View on Github external
Block.prototype.hide = function(fn){
  if (this.hidden) return;
  fastdom.write(function(){
    if (fn) afterTransition.once(this.el, fn);
    this.classes.add('hidden');
    this.el.setAttribute('aria-hidden', true);
  }.bind(this));
  this.hidden = true;
  return this;
};
github bmcmahen / cast / dist / cast.js View on Github external
Block.prototype.hide = function(fn){
  if (this.hidden) return;
  fastdom.write(function(){
    if (fn) afterTransition.once(this.el, fn);
    this.classes.add('hidden');
    this.el.setAttribute('aria-hidden', true);
  }.bind(this));
  this.hidden = true;
  return this;
};
github zetter / react-crossword / src / javascripts / lib / scroller.js View on Github external
setTimeout(() => {
    clearInterval(interval);
    fastdom.write(() => $container.scrollTop(offset));
  }, duration);
};

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