/
asias
/
new
Обзор
Документация
Войти
/
asias
/
new
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/react-hot-toast/src/core/utils.ts
19 строк
509 B
AnastasyaDemina
project
07 дек 2025, 23:03
07 дек 2025, 23:03
7c21e25
Код
Авторство
О чём код?
export const genId = (() => { let count = 0; return () => { return (++count).toString(); }; })(); export const prefersReducedMotion = (() => { // Cache result let shouldReduceMotion: boolean | undefined = undefined; return () => { if (shouldReduceMotion === undefined && typeof window !== 'undefined') { const mediaQuery = matchMedia('(prefers-reduced-motion: reduce)'); shouldReduceMotion = !mediaQuery || mediaQuery.matches; } return shouldReduceMotion; }; })();