mirror of
https://github.com/maputnik/editor.git
synced 2026-04-04 00:20:01 +00:00
Initial migration to typescript (#845)
This migrates some utilities classes from javascript to typescript. Nothing special about the migration, mainly added types and made sure the code adheres to the strict mode. I have picked some small files so git doesn't think they are the same since they are "very different". I hope that in later PRs, when migrating lager files this won't be an issues.
This commit is contained in:
8
src/libs/accessibility.ts
Normal file
8
src/libs/accessibility.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import throttle from 'lodash.throttle'
|
||||
|
||||
export default {
|
||||
// Throttle for 3 seconds so when a user enables it they don't have to refresh the page.
|
||||
reducedMotionEnabled: throttle(() => {
|
||||
return window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
||||
}, 3000)
|
||||
}
|
||||
Reference in New Issue
Block a user