UNPKG

storybook-addon-performance

Version:

A storybook addon to help better understand and debug performance for React components

61 lines (58 loc) 1.02 kB
import { runGroup } from "./chunk-GYR7DIHM.mjs"; import { getResultForStaticTask } from "./chunk-NM3VPNFF.mjs"; import { getResultForTimedTask } from "./chunk-PZAIXLJP.mjs"; import { toSafeElement } from "./chunk-4KNXMVP2.mjs"; // src/task-runner/index.ts async function runAll({ groups, getNode, samples, copies }) { const value = []; for (const group of groups) { const results = await runGroup({ group, getElement: () => toSafeElement({ getNode, copies }), samples }); value.push(results); } return value; } async function runOneTimed({ task, getNode, copies, samples }) { const result = await getResultForTimedTask({ task, getElement: () => toSafeElement({ getNode, copies }), samples }); return result; } async function runOneStatic({ task, getNode, copies }) { return getResultForStaticTask({ task, getElement: () => toSafeElement({ getNode, copies }) }); } export { runAll, runOneTimed, runOneStatic };