Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 778 Bytes

File metadata and controls

39 lines (27 loc) · 778 Bytes

@terra-dev/audit-fastdom

Deduplicate fastdom callbacks.

img.png

API

index.ts

export function auditMeasure(fn: () => void): () => void {}

Usage

//import { measure } from 'fastdom'
//
//window.addEventListener('wheel', () => {
//  measure(() => {
//    // do fastdom measure action
//  })
//})

import { auditMeasure } from '@terra-dev/audit-fastdom';

const callback = auditMeasure(() => {
  // do fastdom measure action
});

window.addEventListener('wheel', () => {
  callback();
});