seitu 0.5.4 → 0.7.0
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.
- package/dist/core/subscription.d.ts +10 -4
- package/dist/{core-3fd1NXIt.js → core-DLt97Ptv.js} +9 -11
- package/dist/core.js +1 -1
- package/dist/react.js +23 -282
- package/dist/web.js +10 -10
- package/package.json +5 -5
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export interface SubscribeOptions {
|
|
2
|
+
/**
|
|
3
|
+
* When `true`, the callback is invoked immediately with the current value upon subscribing.
|
|
4
|
+
*/
|
|
5
|
+
immediate?: boolean;
|
|
6
|
+
}
|
|
1
7
|
export interface Subscribable<V> {
|
|
2
|
-
'subscribe': (callback: (value: V) => any) => () => void;
|
|
8
|
+
'subscribe': (callback: (value: V) => any, options?: SubscribeOptions) => () => void;
|
|
3
9
|
'~': {
|
|
4
10
|
/**
|
|
5
11
|
* Type type with returned value of the subscription.
|
|
@@ -23,7 +29,7 @@ export interface Removable {
|
|
|
23
29
|
export interface Destroyable {
|
|
24
30
|
destroy: () => void;
|
|
25
31
|
}
|
|
26
|
-
export declare function createSubscription
|
|
27
|
-
subscribe: (callback: (
|
|
28
|
-
notify: (
|
|
32
|
+
export declare function createSubscription(): {
|
|
33
|
+
subscribe: (callback: () => any, options?: SubscribeOptions) => () => void;
|
|
34
|
+
notify: () => void;
|
|
29
35
|
};
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
function e() {
|
|
3
3
|
let e = /* @__PURE__ */ new Set();
|
|
4
4
|
return {
|
|
5
|
-
subscribe(t) {
|
|
6
|
-
return e.add(t), () => {
|
|
5
|
+
subscribe(t, n) {
|
|
6
|
+
return n?.immediate && t(), e.add(t), () => {
|
|
7
7
|
e.delete(t);
|
|
8
8
|
};
|
|
9
9
|
},
|
|
10
|
-
notify(
|
|
11
|
-
e.forEach((e) => e(
|
|
10
|
+
notify() {
|
|
11
|
+
e.forEach((e) => e());
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
}
|
|
@@ -19,8 +19,8 @@ function t(t, n) {
|
|
|
19
19
|
for (let e of a) e.subscribe(() => i());
|
|
20
20
|
return {
|
|
21
21
|
get: s,
|
|
22
|
-
subscribe(e) {
|
|
23
|
-
return r(() => e(s()));
|
|
22
|
+
subscribe(e, t) {
|
|
23
|
+
return r(() => e(s()), t);
|
|
24
24
|
},
|
|
25
25
|
"~": {
|
|
26
26
|
output: null,
|
|
@@ -57,9 +57,7 @@ function r(t) {
|
|
|
57
57
|
s.set(t), a();
|
|
58
58
|
},
|
|
59
59
|
getDefaultValue: (e) => o[e],
|
|
60
|
-
subscribe: (e) => r(() =>
|
|
61
|
-
e(c());
|
|
62
|
-
}),
|
|
60
|
+
subscribe: (e, t) => r(() => e(c()), t),
|
|
63
61
|
destroy: () => {
|
|
64
62
|
s.destroy?.();
|
|
65
63
|
},
|
|
@@ -88,8 +86,8 @@ function a(t) {
|
|
|
88
86
|
let t = typeof e == "function" ? e(n) : e;
|
|
89
87
|
t !== n && (n = t, i());
|
|
90
88
|
},
|
|
91
|
-
subscribe(e) {
|
|
92
|
-
return r(() => e(a()));
|
|
89
|
+
subscribe(e, t) {
|
|
90
|
+
return r(() => e(a()), t);
|
|
93
91
|
},
|
|
94
92
|
"~": {
|
|
95
93
|
output: null,
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, n as t, o as n, r, t as i } from "./core-
|
|
1
|
+
import { a as e, n as t, o as n, r, t as i } from "./core-DLt97Ptv.js";
|
|
2
2
|
export { e as createComputed, t as createSchemaStore, r as createSchemaStoreMemoryProvider, i as createStore, n as createSubscription };
|
package/dist/react.js
CHANGED
|
@@ -1,288 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var { getOwnPropertyNames: t, getOwnPropertySymbols: n } = Object, { hasOwnProperty: r } = Object.prototype;
|
|
4
|
-
function i(e, t) {
|
|
5
|
-
return function(n, r, i) {
|
|
6
|
-
return e(n, r, i) && t(n, r, i);
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function a(e) {
|
|
10
|
-
return function(t, n, r) {
|
|
11
|
-
if (!t || !n || typeof t != "object" || typeof n != "object") return e(t, n, r);
|
|
12
|
-
let { cache: i } = r, a = i.get(t), o = i.get(n);
|
|
13
|
-
if (a && o) return a === n && o === t;
|
|
14
|
-
i.set(t, n), i.set(n, t);
|
|
15
|
-
let s = e(t, n, r);
|
|
16
|
-
return i.delete(t), i.delete(n), s;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function o(e) {
|
|
20
|
-
return t(e).concat(n(e));
|
|
21
|
-
}
|
|
22
|
-
var s = Object.hasOwn || ((e, t) => r.call(e, t)), c = "__v", l = "__o", u = "_owner", { getOwnPropertyDescriptor: d, keys: f } = Object, p = Object.is || function(e, t) {
|
|
23
|
-
return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
|
|
24
|
-
};
|
|
25
|
-
function m(e, t) {
|
|
26
|
-
return e === t;
|
|
27
|
-
}
|
|
28
|
-
function h(e, t) {
|
|
29
|
-
return e.byteLength === t.byteLength && E(new Uint8Array(e), new Uint8Array(t));
|
|
30
|
-
}
|
|
31
|
-
function g(e, t, n) {
|
|
32
|
-
let r = e.length;
|
|
33
|
-
if (t.length !== r) return !1;
|
|
34
|
-
for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
|
|
35
|
-
return !0;
|
|
36
|
-
}
|
|
37
|
-
function _(e, t) {
|
|
38
|
-
return e.byteLength === t.byteLength && E(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
|
|
39
|
-
}
|
|
40
|
-
function v(e, t) {
|
|
41
|
-
return p(e.getTime(), t.getTime());
|
|
42
|
-
}
|
|
43
|
-
function y(e, t) {
|
|
44
|
-
return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
|
|
45
|
-
}
|
|
46
|
-
function b(e, t, n) {
|
|
47
|
-
let r = e.size;
|
|
48
|
-
if (r !== t.size) return !1;
|
|
49
|
-
if (!r) return !0;
|
|
50
|
-
let i = Array(r), a = e.entries(), o, s, c = 0;
|
|
51
|
-
for (; (o = a.next()) && !o.done;) {
|
|
52
|
-
let r = t.entries(), a = !1, l = 0;
|
|
53
|
-
for (; (s = r.next()) && !s.done;) {
|
|
54
|
-
if (i[l]) {
|
|
55
|
-
l++;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
let r = o.value, u = s.value;
|
|
59
|
-
if (n.equals(r[0], u[0], c, l, e, t, n) && n.equals(r[1], u[1], r[0], u[0], e, t, n)) {
|
|
60
|
-
a = i[l] = !0;
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
l++;
|
|
64
|
-
}
|
|
65
|
-
if (!a) return !1;
|
|
66
|
-
c++;
|
|
67
|
-
}
|
|
68
|
-
return !0;
|
|
69
|
-
}
|
|
70
|
-
function x(e, t, n) {
|
|
71
|
-
let r = f(e), i = r.length;
|
|
72
|
-
if (f(t).length !== i) return !1;
|
|
73
|
-
for (; i-- > 0;) if (!O(e, t, n, r[i])) return !1;
|
|
74
|
-
return !0;
|
|
75
|
-
}
|
|
76
|
-
function S(e, t, n) {
|
|
77
|
-
let r = o(e), i = r.length;
|
|
78
|
-
if (o(t).length !== i) return !1;
|
|
79
|
-
let a, s, c;
|
|
80
|
-
for (; i-- > 0;) if (a = r[i], !O(e, t, n, a) || (s = d(e, a), c = d(t, a), (s || c) && (!s || !c || s.configurable !== c.configurable || s.enumerable !== c.enumerable || s.writable !== c.writable))) return !1;
|
|
81
|
-
return !0;
|
|
82
|
-
}
|
|
83
|
-
function C(e, t) {
|
|
84
|
-
return p(e.valueOf(), t.valueOf());
|
|
85
|
-
}
|
|
86
|
-
function w(e, t) {
|
|
87
|
-
return e.source === t.source && e.flags === t.flags;
|
|
88
|
-
}
|
|
89
|
-
function T(e, t, n) {
|
|
90
|
-
let r = e.size;
|
|
91
|
-
if (r !== t.size) return !1;
|
|
92
|
-
if (!r) return !0;
|
|
93
|
-
let i = Array(r), a = e.values(), o, s;
|
|
94
|
-
for (; (o = a.next()) && !o.done;) {
|
|
95
|
-
let r = t.values(), a = !1, c = 0;
|
|
96
|
-
for (; (s = r.next()) && !s.done;) {
|
|
97
|
-
if (!i[c] && n.equals(o.value, s.value, o.value, s.value, e, t, n)) {
|
|
98
|
-
a = i[c] = !0;
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
c++;
|
|
102
|
-
}
|
|
103
|
-
if (!a) return !1;
|
|
104
|
-
}
|
|
105
|
-
return !0;
|
|
106
|
-
}
|
|
107
|
-
function E(e, t) {
|
|
108
|
-
let n = e.byteLength;
|
|
109
|
-
if (t.byteLength !== n || e.byteOffset !== t.byteOffset) return !1;
|
|
110
|
-
for (; n-- > 0;) if (e[n] !== t[n]) return !1;
|
|
111
|
-
return !0;
|
|
112
|
-
}
|
|
113
|
-
function D(e, t) {
|
|
114
|
-
return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
|
|
115
|
-
}
|
|
116
|
-
function O(e, t, n, r) {
|
|
117
|
-
return (r === u || r === l || r === c) && (e.$$typeof || t.$$typeof) ? !0 : s(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
|
|
118
|
-
}
|
|
119
|
-
var k = Object.prototype.toString;
|
|
120
|
-
function A(e) {
|
|
121
|
-
let t = P(e), { areArraysEqual: n, areDatesEqual: r, areFunctionsEqual: i, areMapsEqual: a, areNumbersEqual: o, areObjectsEqual: s, areRegExpsEqual: c, areSetsEqual: l, getUnsupportedCustomComparator: u } = e;
|
|
122
|
-
return function(e, d, f) {
|
|
123
|
-
if (e === d) return !0;
|
|
124
|
-
if (e == null || d == null) return !1;
|
|
125
|
-
let p = typeof e;
|
|
126
|
-
if (p !== typeof d) return !1;
|
|
127
|
-
if (p !== "object") return p === "number" || p === "bigint" ? o(e, d, f) : p === "function" ? i(e, d, f) : !1;
|
|
128
|
-
let m = e.constructor;
|
|
129
|
-
if (m !== d.constructor) return !1;
|
|
130
|
-
if (m === Object) return s(e, d, f);
|
|
131
|
-
if (m === Array) return n(e, d, f);
|
|
132
|
-
if (m === Date) return r(e, d, f);
|
|
133
|
-
if (m === RegExp) return c(e, d, f);
|
|
134
|
-
if (m === Map) return a(e, d, f);
|
|
135
|
-
if (m === Set) return l(e, d, f);
|
|
136
|
-
if (m === Promise) return !1;
|
|
137
|
-
if (Array.isArray(e)) return n(e, d, f);
|
|
138
|
-
let h = k.call(e), g = t[h];
|
|
139
|
-
if (g) return g(e, d, f);
|
|
140
|
-
let _ = u && u(e, d, f, h);
|
|
141
|
-
return _ ? _(e, d, f) : !1;
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function j({ circular: e, createCustomConfig: t, strict: n }) {
|
|
145
|
-
let r = {
|
|
146
|
-
areArrayBuffersEqual: h,
|
|
147
|
-
areArraysEqual: n ? S : g,
|
|
148
|
-
areDataViewsEqual: _,
|
|
149
|
-
areDatesEqual: v,
|
|
150
|
-
areErrorsEqual: y,
|
|
151
|
-
areFunctionsEqual: m,
|
|
152
|
-
areMapsEqual: n ? i(b, S) : b,
|
|
153
|
-
areNumbersEqual: p,
|
|
154
|
-
areObjectsEqual: n ? S : x,
|
|
155
|
-
arePrimitiveWrappersEqual: C,
|
|
156
|
-
areRegExpsEqual: w,
|
|
157
|
-
areSetsEqual: n ? i(T, S) : T,
|
|
158
|
-
areTypedArraysEqual: n ? i(E, S) : E,
|
|
159
|
-
areUrlsEqual: D,
|
|
160
|
-
getUnsupportedCustomComparator: void 0
|
|
161
|
-
};
|
|
162
|
-
if (t && (r = Object.assign({}, r, t(r))), e) {
|
|
163
|
-
let e = a(r.areArraysEqual), t = a(r.areMapsEqual), n = a(r.areObjectsEqual), i = a(r.areSetsEqual);
|
|
164
|
-
r = Object.assign({}, r, {
|
|
165
|
-
areArraysEqual: e,
|
|
166
|
-
areMapsEqual: t,
|
|
167
|
-
areObjectsEqual: n,
|
|
168
|
-
areSetsEqual: i
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
return r;
|
|
172
|
-
}
|
|
173
|
-
function M(e) {
|
|
174
|
-
return function(t, n, r, i, a, o, s) {
|
|
175
|
-
return e(t, n, s);
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function N({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
|
|
179
|
-
if (n) return function(a, o) {
|
|
180
|
-
let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
|
|
181
|
-
return t(a, o, {
|
|
182
|
-
cache: s,
|
|
183
|
-
equals: r,
|
|
184
|
-
meta: c,
|
|
185
|
-
strict: i
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
if (e) return function(e, n) {
|
|
189
|
-
return t(e, n, {
|
|
190
|
-
cache: /* @__PURE__ */ new WeakMap(),
|
|
191
|
-
equals: r,
|
|
192
|
-
meta: void 0,
|
|
193
|
-
strict: i
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
let a = {
|
|
197
|
-
cache: void 0,
|
|
198
|
-
equals: r,
|
|
199
|
-
meta: void 0,
|
|
200
|
-
strict: i
|
|
201
|
-
};
|
|
202
|
-
return function(e, n) {
|
|
203
|
-
return t(e, n, a);
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
function P({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areNumbersEqual: s, areObjectsEqual: c, arePrimitiveWrappersEqual: l, areRegExpsEqual: u, areSetsEqual: d, areTypedArraysEqual: f, areUrlsEqual: p }) {
|
|
207
|
-
return {
|
|
208
|
-
"[object Arguments]": c,
|
|
209
|
-
"[object Array]": t,
|
|
210
|
-
"[object ArrayBuffer]": e,
|
|
211
|
-
"[object AsyncGeneratorFunction]": a,
|
|
212
|
-
"[object BigInt]": s,
|
|
213
|
-
"[object BigInt64Array]": f,
|
|
214
|
-
"[object BigUint64Array]": f,
|
|
215
|
-
"[object Boolean]": l,
|
|
216
|
-
"[object DataView]": n,
|
|
217
|
-
"[object Date]": r,
|
|
218
|
-
"[object Error]": i,
|
|
219
|
-
"[object Float16Array]": f,
|
|
220
|
-
"[object Float32Array]": f,
|
|
221
|
-
"[object Float64Array]": f,
|
|
222
|
-
"[object Function]": a,
|
|
223
|
-
"[object GeneratorFunction]": a,
|
|
224
|
-
"[object Int8Array]": f,
|
|
225
|
-
"[object Int16Array]": f,
|
|
226
|
-
"[object Int32Array]": f,
|
|
227
|
-
"[object Map]": o,
|
|
228
|
-
"[object Number]": l,
|
|
229
|
-
"[object Object]": (e, t, n) => typeof e.then != "function" && typeof t.then != "function" && c(e, t, n),
|
|
230
|
-
"[object RegExp]": u,
|
|
231
|
-
"[object Set]": d,
|
|
232
|
-
"[object String]": l,
|
|
233
|
-
"[object URL]": p,
|
|
234
|
-
"[object Uint8Array]": f,
|
|
235
|
-
"[object Uint8ClampedArray]": f,
|
|
236
|
-
"[object Uint16Array]": f,
|
|
237
|
-
"[object Uint32Array]": f
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
var F = I();
|
|
241
|
-
I({ strict: !0 }), I({ circular: !0 }), I({
|
|
242
|
-
circular: !0,
|
|
243
|
-
strict: !0
|
|
244
|
-
}), I({ createInternalComparator: () => p }), I({
|
|
245
|
-
strict: !0,
|
|
246
|
-
createInternalComparator: () => p
|
|
247
|
-
}), I({
|
|
248
|
-
circular: !0,
|
|
249
|
-
createInternalComparator: () => p
|
|
250
|
-
}), I({
|
|
251
|
-
circular: !0,
|
|
252
|
-
createInternalComparator: () => p,
|
|
253
|
-
strict: !0
|
|
254
|
-
});
|
|
255
|
-
function I(e = {}) {
|
|
256
|
-
let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = A(j(e));
|
|
257
|
-
return N({
|
|
258
|
-
circular: t,
|
|
259
|
-
comparator: a,
|
|
260
|
-
createState: r,
|
|
261
|
-
equals: n ? n(a) : M(a),
|
|
262
|
-
strict: i
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
//#endregion
|
|
1
|
+
import { deepEqual as e } from "fast-equals";
|
|
2
|
+
import * as t from "react";
|
|
266
3
|
//#region src/react/hooks.ts
|
|
267
|
-
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
4
|
+
function n(n, r) {
|
|
5
|
+
let { selector: i, deps: a = [] } = r ?? {}, o = typeof n == "function", s = o ? n : () => n, c = t.useMemo(() => s(), o ? a : [n, ...a]), l = t.useRef(c), u = t.useRef(c), d = t.useRef(void 0);
|
|
6
|
+
if (u.current !== c) {
|
|
7
|
+
let e = u.current;
|
|
8
|
+
u.current = c, l.current = c, d.current = void 0, o && e.destroy?.();
|
|
9
|
+
}
|
|
10
|
+
t.useEffect(() => () => {
|
|
11
|
+
o && l.current.destroy?.();
|
|
12
|
+
}, []);
|
|
13
|
+
let f = t.useCallback((e) => c.subscribe(() => {
|
|
14
|
+
e();
|
|
15
|
+
}), [c]), p = t.useRef(i);
|
|
16
|
+
p.current !== i && (p.current = i, d.current = void 0);
|
|
17
|
+
let m = t.useCallback(() => {
|
|
18
|
+
let t = p.current, n = t ? t(c.get()) : c.get(), r = d.current;
|
|
19
|
+
return r !== void 0 && e(r, n) ? r : (d.current = n, n);
|
|
20
|
+
}, [c]);
|
|
21
|
+
return t.useSyncExternalStore(f, m, m);
|
|
281
22
|
}
|
|
282
23
|
//#endregion
|
|
283
24
|
//#region src/react/components.tsx
|
|
284
|
-
function
|
|
285
|
-
return n(
|
|
25
|
+
function r({ value: e, selector: t, children: r }) {
|
|
26
|
+
return r(n(e, { selector: t }));
|
|
286
27
|
}
|
|
287
28
|
//#endregion
|
|
288
|
-
export {
|
|
29
|
+
export { r as Subscription, n as useSubscription };
|
package/dist/web.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as e, n as t, o as n } from "./core-
|
|
1
|
+
import { i as e, n as t, o as n } from "./core-DLt97Ptv.js";
|
|
2
2
|
//#region src/web/is-online.ts
|
|
3
3
|
function r() {
|
|
4
4
|
let { subscribe: e, notify: t } = n(), r = () => typeof navigator > "u" ? !0 : navigator.onLine, i = () => t();
|
|
5
5
|
return typeof window < "u" && (window.addEventListener("online", i), window.addEventListener("offline", i)), {
|
|
6
6
|
get: r,
|
|
7
|
-
subscribe: (t) => e(() => t(r())),
|
|
7
|
+
subscribe: (t, n) => e(() => t(r()), n),
|
|
8
8
|
destroy: () => {
|
|
9
9
|
typeof window < "u" && (window.removeEventListener("online", i), window.removeEventListener("offline", i));
|
|
10
10
|
},
|
|
@@ -131,7 +131,7 @@ function o(t) {
|
|
|
131
131
|
newValue: a
|
|
132
132
|
})), i = !1, c();
|
|
133
133
|
},
|
|
134
|
-
subscribe: (e) => s(() => e(l())),
|
|
134
|
+
subscribe: (e, t) => s(() => e(l()), t),
|
|
135
135
|
remove: () => {
|
|
136
136
|
typeof window > "u" || window[r].removeItem(t.key);
|
|
137
137
|
},
|
|
@@ -158,7 +158,7 @@ function c(e) {
|
|
|
158
158
|
let { subscribe: t, notify: r } = n(), i = typeof window > "u" ? null : window.matchMedia(e.query), a = () => i?.matches ?? e.defaultMatches ?? !1, o = () => r();
|
|
159
159
|
return i?.addEventListener("change", o), {
|
|
160
160
|
get: a,
|
|
161
|
-
subscribe: (e) => t(() => e(a())),
|
|
161
|
+
subscribe: (e, n) => t(() => e(a()), n),
|
|
162
162
|
destroy: () => {
|
|
163
163
|
i?.removeEventListener("change", o);
|
|
164
164
|
},
|
|
@@ -206,12 +206,12 @@ function u(e) {
|
|
|
206
206
|
};
|
|
207
207
|
return {
|
|
208
208
|
get: c,
|
|
209
|
-
subscribe: (e) => {
|
|
210
|
-
let
|
|
211
|
-
if (!
|
|
212
|
-
let
|
|
213
|
-
return
|
|
214
|
-
|
|
209
|
+
subscribe: (e, t) => {
|
|
210
|
+
let n = s();
|
|
211
|
+
if (!n) return e(c()), () => {};
|
|
212
|
+
let r = i(() => e(c()), t), a = () => e(c());
|
|
213
|
+
return n.addEventListener("scroll", a, { passive: !0 }), () => {
|
|
214
|
+
r(), n.removeEventListener("scroll", a);
|
|
215
215
|
};
|
|
216
216
|
},
|
|
217
217
|
"~": {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "seitu",
|
|
3
3
|
"displayName": "Seitu",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.7.0",
|
|
6
6
|
"private": false,
|
|
7
7
|
"author": "Valerii Strilets",
|
|
8
8
|
"license": "MIT",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"@testing-library/react": "^16.3.2",
|
|
66
66
|
"@types/react": "^19.2.14",
|
|
67
67
|
"@vitejs/plugin-react": "^5.1.4",
|
|
68
|
-
"happy-dom": "^20.8.
|
|
68
|
+
"happy-dom": "^20.8.9",
|
|
69
69
|
"react-dom": "^19.2.4",
|
|
70
|
-
"type-fest": "^5.
|
|
70
|
+
"type-fest": "^5.5.0",
|
|
71
71
|
"typescript": "^5.9.3",
|
|
72
|
-
"vite": "^8.0.
|
|
72
|
+
"vite": "^8.0.3",
|
|
73
73
|
"vite-plugin-dts": "^4.5.4",
|
|
74
|
-
"vitest": "^4.
|
|
74
|
+
"vitest": "^4.1.2",
|
|
75
75
|
"zod": "^4.3.6"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|