Move accessibility checks into module.

This commit is contained in:
orangemug
2018-05-11 09:32:57 +01:00
parent c241a6e280
commit 7cb2c36ac9
2 changed files with 14 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
import lodash from 'lodash'
// Throttle for 3 seconds so when a user enables it they don't have to refresh the page.
const reducedMotionEnabled = lodash.throttle(() => {
return window.matchMedia("(prefers-reduced-motion: reduce)").matches
}, 3000);
export default {
reducedMotionEnabled
}