UNPKG

@tapjs/reporter

Version:
11 lines 393 B
import { useLayoutEffect, useState } from 'react'; import { listenCleanup } from '../listen-cleanup.js'; /** * Return true if the test is done, otherwise false */ export const useIsDone = (test) => { let [done, setDone] = useState(false); useLayoutEffect(() => listenCleanup(test, 'complete', () => setDone(true)), [test]); return done; }; //# sourceMappingURL=use-is-done.js.map