diff --git a/assets/resources/run-at.js b/assets/resources/run-at.js index f9971155a..1119699e5 100644 --- a/assets/resources/run-at.js +++ b/assets/resources/run-at.js @@ -26,7 +26,23 @@ import { safeSelf } from './safe-self.js'; /* eslint no-prototype-builtins: 0 */ -/******************************************************************************/ +/** + * @helperScriptlet run-at.fn + * + * @description + * Execute a function at a specific page-load milestone. + * + * @param fn + * The function to call. + * + * @param when + * An identifier which tells when the function should be executed. + * See . + * + * @example + * `runAt(( ) => { start(); }, 'interactive')` + * + * */ export function runAt(fn, when) { const intFromReadyState = state => {