📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final - MANUAL-VENDAS.md: Estratégia comercial e vendas - MANUAL-TECNICO.md: Infraestrutura e deploy - README.md: Visão geral do projeto
This commit is contained in:
24
frontend/node_modules/framer-motion/dist/es/utils/delay.mjs
generated
vendored
Normal file
24
frontend/node_modules/framer-motion/dist/es/utils/delay.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { secondsToMilliseconds } from 'motion-utils';
|
||||
import { time } from '../frameloop/sync-time.mjs';
|
||||
import { frame, cancelFrame } from '../frameloop/frame.mjs';
|
||||
|
||||
/**
|
||||
* Timeout defined in ms
|
||||
*/
|
||||
function delay(callback, timeout) {
|
||||
const start = time.now();
|
||||
const checkElapsed = ({ timestamp }) => {
|
||||
const elapsed = timestamp - start;
|
||||
if (elapsed >= timeout) {
|
||||
cancelFrame(checkElapsed);
|
||||
callback(elapsed - timeout);
|
||||
}
|
||||
};
|
||||
frame.read(checkElapsed, true);
|
||||
return () => cancelFrame(checkElapsed);
|
||||
}
|
||||
function delayInSeconds(callback, timeout) {
|
||||
return delay(callback, secondsToMilliseconds(timeout));
|
||||
}
|
||||
|
||||
export { delay, delayInSeconds };
|
||||
Reference in New Issue
Block a user