seitu 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/web.js +7 -14
  2. package/package.json +1 -1
package/dist/web.js CHANGED
@@ -102,21 +102,14 @@ function o(e) {
102
102
  //#endregion
103
103
  //#region src/web/media-query.ts
104
104
  function s(e) {
105
- let { subscribe: t, notify: r } = n(), i = () => {
106
- if (typeof window > "u") return e.defaultMatches ?? !1;
107
- try {
108
- return window.matchMedia(e.query).matches;
109
- } catch {
110
- return e.defaultMatches ?? !1;
111
- }
112
- };
113
- return {
114
- get: i,
105
+ let { subscribe: t, notify: r } = n(), i = typeof window > "u" ? null : window.matchMedia(e.query), a = () => i?.matches ?? e.defaultMatches ?? !1;
106
+ return i?.addEventListener("change", () => r()), {
107
+ get: a,
115
108
  subscribe: (n) => {
116
- if (typeof window > "u") return n(i()), () => {};
117
- let r = t(() => n(i())), a = window.matchMedia(e.query), o = () => n(i());
118
- return a.addEventListener("change", o), () => {
119
- r(), a.removeEventListener("change", o);
109
+ if (typeof window > "u") return n(a()), () => {};
110
+ let r = t(() => n(a())), i = window.matchMedia(e.query), o = () => n(a());
111
+ return i.addEventListener("change", o), () => {
112
+ r(), i.removeEventListener("change", o);
120
113
  };
121
114
  },
122
115
  "~": {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "seitu",
3
3
  "displayName": "Seitu",
4
4
  "type": "module",
5
- "version": "0.4.3",
5
+ "version": "0.4.4",
6
6
  "private": false,
7
7
  "author": "Valerii Strilets",
8
8
  "license": "MIT",