svelte-mq-store
Advanced tools
Comparing version 2.1.0 to 2.1.1
import { readable } from 'svelte/store'; | ||
export const listen = (key, fallback) => { | ||
const browser = typeof window !== 'undefined'; | ||
return readable(browser ? matchMedia(key).matches : fallback, (set) => { | ||
if (browser) { | ||
const available = typeof matchMedia !== 'undefined'; | ||
return readable(available ? matchMedia(key).matches : fallback, (set) => { | ||
if (available) { | ||
matchMedia(key).addEventListener('change', (e) => set(e.matches)); | ||
@@ -7,0 +7,0 @@ } |
{ | ||
"name": "svelte-mq-store", | ||
"description": "📱 Create any media-query store in Svelte", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "exports": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5120