seitu 0.4.4 → 0.4.5

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.
@@ -1,5 +1,5 @@
1
- import type { Readable, Subscribable } from '../core/index';
2
- export interface MediaQuery extends Subscribable<boolean>, Readable<boolean> {
1
+ import type { Destroyable, Readable, Subscribable } from '../core/index';
2
+ export interface MediaQuery extends Subscribable<boolean>, Readable<boolean>, Destroyable {
3
3
  }
4
4
  type MinMaxPrefix = 'min-' | 'max-' | '';
5
5
  type CSSUnitSuffix = 'px' | 'em' | 'rem' | 'vw' | 'vh' | 'dvw' | 'dvh' | 'svw' | 'svh' | 'lvw' | 'lvh' | 'cqw' | 'cqh' | 'vmin' | 'vmax' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
package/dist/web.js CHANGED
@@ -102,15 +102,12 @@ 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 = typeof window > "u" ? null : window.matchMedia(e.query), a = () => i?.matches ?? e.defaultMatches ?? !1;
106
- return i?.addEventListener("change", () => r()), {
105
+ let { subscribe: t, notify: r } = n(), i = typeof window > "u" ? null : window.matchMedia(e.query), a = () => i?.matches ?? e.defaultMatches ?? !1, o = () => r();
106
+ return i?.addEventListener("change", o), {
107
107
  get: a,
108
- subscribe: (n) => {
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);
113
- };
108
+ subscribe: (e) => t(() => e(a())),
109
+ destroy: () => {
110
+ i?.removeEventListener("change", o);
114
111
  },
115
112
  "~": {
116
113
  output: null,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "seitu",
3
3
  "displayName": "Seitu",
4
4
  "type": "module",
5
- "version": "0.4.4",
5
+ "version": "0.4.5",
6
6
  "private": false,
7
7
  "author": "Valerii Strilets",
8
8
  "license": "MIT",