@vef-framework/hooks 2.0.3 → 2.0.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.
Files changed (55) hide show
  1. package/dist/cjs/index.cjs +1 -172
  2. package/dist/cjs/lib.cjs +1 -148
  3. package/dist/cjs/use-authorized-items/index.cjs +1 -20
  4. package/dist/cjs/use-breakpoints/index.cjs +1 -74
  5. package/dist/cjs/use-check-permission/index.cjs +1 -18
  6. package/dist/cjs/use-data-dict-query/index.cjs +1 -34
  7. package/dist/cjs/use-data-options/index.cjs +1 -119
  8. package/dist/cjs/use-deep-callback/index.cjs +1 -13
  9. package/dist/cjs/use-deep-compare/index.cjs +1 -36
  10. package/dist/cjs/use-deep-effect/index.cjs +1 -13
  11. package/dist/cjs/use-deep-isomorphic-effect/index.cjs +1 -14
  12. package/dist/cjs/use-deep-layout-effect/index.cjs +1 -13
  13. package/dist/cjs/use-deep-memo/index.cjs +1 -13
  14. package/dist/cjs/use-document-event/index.cjs +1 -22
  15. package/dist/cjs/use-emitter-event/index.cjs +1 -22
  16. package/dist/cjs/use-has-fetching/index.cjs +1 -17
  17. package/dist/cjs/use-has-mutating/index.cjs +1 -16
  18. package/dist/cjs/use-is-authorized/index.cjs +1 -18
  19. package/dist/cjs/use-latest/index.cjs +1 -14
  20. package/dist/cjs/use-raf-state/index.cjs +1 -23
  21. package/dist/cjs/use-shallow-callback/index.cjs +1 -13
  22. package/dist/cjs/use-shallow-compare/index.cjs +1 -36
  23. package/dist/cjs/use-shallow-effect/index.cjs +1 -13
  24. package/dist/cjs/use-shallow-isomorphic-effect/index.cjs +1 -14
  25. package/dist/cjs/use-shallow-layout-effect/index.cjs +1 -13
  26. package/dist/cjs/use-shallow-memo/index.cjs +1 -13
  27. package/dist/cjs/use-singleton/index.cjs +1 -16
  28. package/dist/es/index.js +85 -29
  29. package/dist/es/lib.js +51 -23
  30. package/dist/es/use-authorized-items/index.js +12 -13
  31. package/dist/es/use-breakpoints/index.js +43 -58
  32. package/dist/es/use-check-permission/index.js +10 -12
  33. package/dist/es/use-data-dict-query/index.js +22 -26
  34. package/dist/es/use-data-options/index.js +72 -105
  35. package/dist/es/use-deep-callback/index.js +7 -8
  36. package/dist/es/use-deep-compare/index.js +19 -30
  37. package/dist/es/use-deep-effect/index.js +7 -8
  38. package/dist/es/use-deep-isomorphic-effect/index.js +8 -9
  39. package/dist/es/use-deep-layout-effect/index.js +7 -8
  40. package/dist/es/use-deep-memo/index.js +7 -8
  41. package/dist/es/use-document-event/index.js +13 -15
  42. package/dist/es/use-emitter-event/index.js +12 -13
  43. package/dist/es/use-has-fetching/index.js +9 -11
  44. package/dist/es/use-has-mutating/index.js +9 -11
  45. package/dist/es/use-is-authorized/index.js +10 -12
  46. package/dist/es/use-latest/index.js +7 -9
  47. package/dist/es/use-raf-state/index.js +11 -16
  48. package/dist/es/use-shallow-callback/index.js +7 -8
  49. package/dist/es/use-shallow-compare/index.js +19 -30
  50. package/dist/es/use-shallow-effect/index.js +7 -8
  51. package/dist/es/use-shallow-isomorphic-effect/index.js +8 -9
  52. package/dist/es/use-shallow-layout-effect/index.js +7 -8
  53. package/dist/es/use-shallow-memo/index.js +7 -8
  54. package/dist/es/use-singleton/index.js +7 -11
  55. package/package.json +3 -3
@@ -1,70 +1,55 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { isNumber } from '@vef-framework/shared';
3
- import { useMemo, useState, useEffect } from 'react';
4
-
5
- function createMediaQuery(value) {
6
- return `(min-width: ${isNumber(value) ? `${value}px` : value})`;
1
+ import { isNumber as c } from "@vef-framework/shared";
2
+ import { useMemo as d, useState as h, useEffect as p } from "react";
3
+ function g(n) {
4
+ return `(min-width: ${c(n) ? `${n}px` : n})`;
7
5
  }
8
- function useBreakpoints(breakpoints, options = {}) {
9
- const { initialBreakpoint, getInitialValueInEffect = false } = options;
10
- const sortedBreakpoints = useMemo(
11
- () => Object.entries(breakpoints).map(([name, value]) => {
6
+ function q(n, u = {}) {
7
+ const { initialBreakpoint: a, getInitialValueInEffect: s = !1 } = u, i = d(
8
+ () => Object.entries(n).map(([r, t]) => ({
9
+ name: r,
10
+ value: t,
11
+ query: g(t),
12
+ order: c(t) ? t : Number.parseInt(t)
13
+ })).toSorted((r, t) => r.order - t.order),
14
+ [n]
15
+ ), [l, f] = h(() => {
16
+ if (globalThis.window === void 0 || s) {
17
+ const e = i.find((o) => o.name === a);
12
18
  return {
13
- name,
14
- value,
15
- query: createMediaQuery(value),
16
- order: isNumber(value) ? value : Number.parseInt(value)
17
- };
18
- }).toSorted((a, b) => a.order - b.order),
19
- [breakpoints]
20
- );
21
- const [state, setState] = useState(() => {
22
- if (globalThis.window === void 0 || getInitialValueInEffect) {
23
- const initialEntry = sortedBreakpoints.find((bp) => bp.name === initialBreakpoint);
24
- return {
25
- current: initialBreakpoint,
26
- value: initialEntry?.value,
27
- matches: initialBreakpoint ? [initialBreakpoint] : []
19
+ current: a,
20
+ value: e?.value,
21
+ matches: a ? [a] : []
28
22
  };
29
23
  }
30
- const matchingBreakpoints = sortedBreakpoints.filter((bp) => globalThis.matchMedia(bp.query).matches);
31
- const currentBreakpoint = matchingBreakpoints.at(-1);
24
+ const r = i.filter((e) => globalThis.matchMedia(e.query).matches), t = r.at(-1);
32
25
  return {
33
- current: currentBreakpoint?.name,
34
- value: currentBreakpoint?.value,
35
- matches: matchingBreakpoints.map((bp) => bp.name)
26
+ current: t?.name,
27
+ value: t?.value,
28
+ matches: r.map((e) => e.name)
36
29
  };
37
30
  });
38
- useEffect(() => {
39
- const mediaQueryLists = sortedBreakpoints.map((bp) => {
40
- return {
41
- name: bp.name,
42
- value: bp.value,
43
- mql: globalThis.matchMedia(bp.query)
44
- };
45
- });
46
- const updateBreakpoint = () => {
47
- const matchingBreakpoints = mediaQueryLists.filter((item) => item.mql.matches);
48
- const currentBreakpoint = matchingBreakpoints.at(-1);
49
- setState({
50
- current: currentBreakpoint?.name,
51
- value: currentBreakpoint?.value,
52
- matches: matchingBreakpoints.map((mbp) => mbp.name)
31
+ return p(() => {
32
+ const r = i.map((e) => ({
33
+ name: e.name,
34
+ value: e.value,
35
+ mql: globalThis.matchMedia(e.query)
36
+ })), t = () => {
37
+ const e = r.filter((m) => m.mql.matches), o = e.at(-1);
38
+ f({
39
+ current: o?.name,
40
+ value: o?.value,
41
+ matches: e.map((m) => m.name)
53
42
  });
54
43
  };
55
- if (getInitialValueInEffect) {
56
- updateBreakpoint();
57
- }
58
- for (const item of mediaQueryLists) {
59
- item.mql.addEventListener("change", updateBreakpoint);
60
- }
44
+ s && t();
45
+ for (const e of r)
46
+ e.mql.addEventListener("change", t);
61
47
  return () => {
62
- for (const item of mediaQueryLists) {
63
- item.mql.removeEventListener("change", updateBreakpoint);
64
- }
48
+ for (const e of r)
49
+ e.mql.removeEventListener("change", t);
65
50
  };
66
- }, [getInitialValueInEffect, sortedBreakpoints]);
67
- return state;
51
+ }, [s, i]), l;
68
52
  }
69
-
70
- export { useBreakpoints };
53
+ export {
54
+ q as useBreakpoints
55
+ };
@@ -1,14 +1,12 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useAppContext, checkPermission } from '@vef-framework/core';
3
- import { useCallback } from 'react';
4
-
5
- function useCheckPermission() {
6
- const { hasPermission = () => true } = useAppContext();
7
- const checkPermission$1 = useCallback(
8
- (permTokens, checkMode) => checkPermission(hasPermission, permTokens, checkMode),
9
- [hasPermission]
1
+ import { useAppContext as i, checkPermission as r } from "@vef-framework/core";
2
+ import { useCallback as c } from "react";
3
+ function u() {
4
+ const { hasPermission: e = () => !0 } = i();
5
+ return c(
6
+ (s, o) => r(e, s, o),
7
+ [e]
10
8
  );
11
- return checkPermission$1;
12
9
  }
13
-
14
- export { useCheckPermission };
10
+ export {
11
+ u as useCheckPermission
12
+ };
@@ -1,30 +1,26 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useAppContext, useQuery, skipQueryToken } from '@vef-framework/core';
3
- import { isFunction, isEmpty } from '@vef-framework/shared';
4
- import { useEffectEvent, useEffect } from 'react';
5
-
6
- function useDataDictQuery({
7
- dataDictKey,
8
- onFetch,
9
- ...options
1
+ import { useAppContext as s, useQuery as c, skipQueryToken as p } from "@vef-framework/core";
2
+ import { isFunction as f, isEmpty as m } from "@vef-framework/shared";
3
+ import { useEffectEvent as y, useEffect as a } from "react";
4
+ function Q({
5
+ dataDictKey: r,
6
+ onFetch: o,
7
+ ...n
10
8
  }) {
11
- const { dataDictQueryFn } = useAppContext();
12
- if (!isFunction(dataDictQueryFn)) {
9
+ const { dataDictQueryFn: e } = s();
10
+ if (!f(e))
13
11
  throw new Error("Data dictionary query function is not provided in the app context.");
14
- }
15
- const result = useQuery({
16
- ...options,
17
- queryFn: isEmpty(dataDictKey) ? skipQueryToken : dataDictQueryFn,
18
- queryKey: [dataDictQueryFn.key, dataDictKey],
19
- staleTime: options?.staleTime ?? Infinity
12
+ const t = c({
13
+ ...n,
14
+ queryFn: m(r) ? p : e,
15
+ queryKey: [e.key, r],
16
+ staleTime: n?.staleTime ?? 1 / 0
17
+ }), i = y((u) => {
18
+ o?.(u);
20
19
  });
21
- const onFetchFn = useEffectEvent((data) => {
22
- onFetch?.(data);
23
- });
24
- useEffect(() => {
25
- result.promise.then(onFetchFn);
26
- }, [result.promise]);
27
- return result;
20
+ return a(() => {
21
+ t.promise.then(i);
22
+ }, [t.promise]), t;
28
23
  }
29
-
30
- export { useDataDictQuery };
24
+ export {
25
+ Q as useDataDictQuery
26
+ };
@@ -1,115 +1,82 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useQuery, skipQueryToken } from '@vef-framework/core';
3
- import { isFunction, get, isNullish, withPinyin, isEmpty, isString } from '@vef-framework/shared';
4
- import { useMemo } from 'react';
5
- import { useDataDictQuery } from '../use-data-dict-query/index.js';
6
-
7
- function extractField(item, extractor, defaultKey) {
8
- if (!extractor) {
9
- return item[defaultKey];
10
- }
11
- if (isFunction(extractor)) {
12
- return extractor(item);
13
- }
14
- return get(item, extractor);
1
+ import { useQuery as F, skipQueryToken as b } from "@vef-framework/core";
2
+ import { isFunction as R, get as k, isNullish as h, withPinyin as q, isEmpty as A, isString as v } from "@vef-framework/shared";
3
+ import { useMemo as E } from "react";
4
+ import { useDataDictQuery as I } from "../use-data-dict-query/index.js";
5
+ function c(r, n, t) {
6
+ return n ? R(n) ? n(r) : k(r, n) : r[t];
15
7
  }
16
- function transformDataItem(item, options, withPinyin$1) {
8
+ function g(r, n, t) {
17
9
  const {
18
- labelKey,
19
- valueKey,
20
- disabledKey,
21
- descriptionKey,
22
- childrenKey
23
- } = options;
24
- const label = extractField(item, labelKey, "label");
25
- const value = extractField(item, valueKey, "value");
26
- const disabled = extractField(item, disabledKey, "disabled");
27
- const description = extractField(item, descriptionKey, "description");
28
- const children = extractField(item, childrenKey, "children");
29
- const option = {
30
- ...item,
31
- label,
32
- value,
33
- ...!isNullish(disabled) && { disabled },
34
- ...!isNullish(description) && { description }
35
- };
36
- const optionWithPinyin = withPinyin$1 ? withPinyin(
37
- option,
10
+ labelKey: s,
11
+ valueKey: u,
12
+ disabledKey: e,
13
+ descriptionKey: i,
14
+ childrenKey: l
15
+ } = n, f = c(r, s, "label"), Q = c(r, u, "value"), a = c(r, e, "disabled"), p = c(r, i, "description"), o = c(r, l, "children"), m = {
16
+ ...r,
17
+ label: f,
18
+ value: Q,
19
+ ...!h(a) && { disabled: a },
20
+ ...!h(p) && { description: p }
21
+ }, d = t ? q(
22
+ m,
38
23
  "label",
39
24
  "description"
40
- ) : option;
41
- if (Array.isArray(children) && children.length > 0) {
42
- optionWithPinyin.children = children.map((child) => transformDataItem(child, options, withPinyin$1));
43
- }
44
- return optionWithPinyin;
25
+ ) : m;
26
+ return Array.isArray(o) && o.length > 0 && (d.children = o.map((y) => g(y, n, t))), d;
45
27
  }
46
- function transformData(data, options, withPinyin) {
47
- if (!data || isEmpty(data)) {
48
- return [];
49
- }
50
- if (withPinyin) {
51
- return data.map((item) => transformDataItem(item, options, true));
52
- }
53
- return data.map((item) => transformDataItem(item, options, false));
28
+ function D(r, n, t) {
29
+ return !r || A(r) ? [] : t ? r.map((s) => g(s, n, !0)) : r.map((s) => g(s, n, !1));
54
30
  }
55
- function useDataOptionsQuery({
56
- queryOptions,
57
- dataDictKey,
58
- labelKey,
59
- valueKey,
60
- disabledKey,
61
- descriptionKey,
62
- childrenKey,
63
- withPinyin = false
31
+ function W({
32
+ queryOptions: r,
33
+ dataDictKey: n,
34
+ labelKey: t,
35
+ valueKey: s,
36
+ disabledKey: u,
37
+ descriptionKey: e,
38
+ childrenKey: i,
39
+ withPinyin: l = !1
64
40
  }) {
65
- const isDataDictQuery = isString(dataDictKey) && dataDictKey.length > 0;
66
- const queryResult = useQuery({
67
- ...queryOptions,
68
- queryFn: isDataDictQuery ? skipQueryToken : queryOptions?.queryFn
69
- });
70
- const dictQueryResult = useDataDictQuery({
71
- dataDictKey
72
- });
73
- const mergedResult = isDataDictQuery ? dictQueryResult : queryResult;
74
- const { data, ...result } = mergedResult;
75
- const options = useMemo(
76
- () => {
77
- if (withPinyin) {
78
- return transformData(
79
- data,
80
- {
81
- labelKey,
82
- valueKey,
83
- disabledKey,
84
- descriptionKey,
85
- childrenKey
86
- },
87
- true
88
- );
89
- }
90
- return transformData(
91
- data,
92
- {
93
- labelKey,
94
- valueKey,
95
- disabledKey,
96
- descriptionKey,
97
- childrenKey
98
- },
99
- false
100
- );
101
- },
41
+ const f = v(n) && n.length > 0, Q = F({
42
+ ...r,
43
+ queryFn: f ? b : r?.queryFn
44
+ }), a = I({
45
+ dataDictKey: n
46
+ }), p = f ? a : Q, { data: o, ...m } = p;
47
+ return { options: E(
48
+ () => l ? D(
49
+ o,
50
+ {
51
+ labelKey: t,
52
+ valueKey: s,
53
+ disabledKey: u,
54
+ descriptionKey: e,
55
+ childrenKey: i
56
+ },
57
+ !0
58
+ ) : D(
59
+ o,
60
+ {
61
+ labelKey: t,
62
+ valueKey: s,
63
+ disabledKey: u,
64
+ descriptionKey: e,
65
+ childrenKey: i
66
+ },
67
+ !1
68
+ ),
102
69
  [
103
- data,
104
- labelKey,
105
- valueKey,
106
- disabledKey,
107
- descriptionKey,
108
- childrenKey,
109
- withPinyin
70
+ o,
71
+ t,
72
+ s,
73
+ u,
74
+ e,
75
+ i,
76
+ l
110
77
  ]
111
- );
112
- return { options, ...result };
78
+ ), ...m };
113
79
  }
114
-
115
- export { useDataOptionsQuery };
80
+ export {
81
+ W as useDataOptionsQuery
82
+ };
@@ -1,9 +1,8 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useCallback } from 'react';
3
- import { useDeepCompare } from '../use-deep-compare/index.js';
4
-
5
- function useDeepCallback(callback, dependencies) {
6
- return useCallback(callback, useDeepCompare(dependencies));
1
+ import { useCallback as o } from "react";
2
+ import { useDeepCompare as p } from "../use-deep-compare/index.js";
3
+ function t(e, r) {
4
+ return o(e, p(r));
7
5
  }
8
-
9
- export { useDeepCallback };
6
+ export {
7
+ t as useDeepCallback
8
+ };
@@ -1,32 +1,21 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { isDeepEqual } from '@vef-framework/shared';
3
- import { useRef } from 'react';
4
-
5
- function useDeepCompare(dependencies) {
6
- const ref = useRef(void 0);
7
- const signalRef = useRef(0);
8
- if (!deepCompare(ref.current, dependencies)) {
9
- ref.current = dependencies;
10
- signalRef.current += 1;
11
- }
12
- return [signalRef.current];
1
+ import { isDeepEqual as o } from "@vef-framework/shared";
2
+ import { useRef as n } from "react";
3
+ function s(e) {
4
+ const r = n(void 0), t = n(0);
5
+ return i(r.current, e) || (r.current = e, t.current += 1), [t.current];
13
6
  }
14
- function deepCompare(previous, current) {
15
- if (!previous || !current) {
16
- return false;
17
- }
18
- if (Object.is(previous, current)) {
19
- return true;
20
- }
21
- if (previous.length !== current.length) {
22
- return false;
23
- }
24
- for (const [index, element] of previous.entries()) {
25
- if (!isDeepEqual(element, current[index])) {
26
- return false;
27
- }
28
- }
29
- return true;
7
+ function i(e, r) {
8
+ if (!e || !r)
9
+ return !1;
10
+ if (Object.is(e, r))
11
+ return !0;
12
+ if (e.length !== r.length)
13
+ return !1;
14
+ for (const [t, f] of e.entries())
15
+ if (!o(f, r[t]))
16
+ return !1;
17
+ return !0;
30
18
  }
31
-
32
- export { useDeepCompare };
19
+ export {
20
+ s as useDeepCompare
21
+ };
@@ -1,9 +1,8 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useEffect } from 'react';
3
- import { useDeepCompare } from '../use-deep-compare/index.js';
4
-
5
- function useDeepEffect(effect, dependencies) {
6
- return useEffect(effect, useDeepCompare(dependencies));
1
+ import { useEffect as f } from "react";
2
+ import { useDeepCompare as o } from "../use-deep-compare/index.js";
3
+ function m(e, r) {
4
+ return f(e, o(r));
7
5
  }
8
-
9
- export { useDeepEffect };
6
+ export {
7
+ m as useDeepEffect
8
+ };
@@ -1,10 +1,9 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import '../lib.js';
3
- import { useDeepCompare } from '../use-deep-compare/index.js';
4
- import { useIsomorphicEffect } from '@mantine/hooks';
5
-
6
- function useDeepIsomorphicEffect(effect, dependencies) {
7
- return useIsomorphicEffect(effect, useDeepCompare(dependencies));
1
+ import "../lib.js";
2
+ import { useDeepCompare as r } from "../use-deep-compare/index.js";
3
+ import { useIsomorphicEffect as p } from "@mantine/hooks";
4
+ function i(e, o) {
5
+ return p(e, r(o));
8
6
  }
9
-
10
- export { useDeepIsomorphicEffect };
7
+ export {
8
+ i as useDeepIsomorphicEffect
9
+ };
@@ -1,9 +1,8 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useLayoutEffect } from 'react';
3
- import { useDeepCompare } from '../use-deep-compare/index.js';
4
-
5
- function useDeepLayoutEffect(effect, dependencies) {
6
- return useLayoutEffect(effect, useDeepCompare(dependencies));
1
+ import { useLayoutEffect as t } from "react";
2
+ import { useDeepCompare as r } from "../use-deep-compare/index.js";
3
+ function p(e, o) {
4
+ return t(e, r(o));
7
5
  }
8
-
9
- export { useDeepLayoutEffect };
6
+ export {
7
+ p as useDeepLayoutEffect
8
+ };
@@ -1,9 +1,8 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useMemo } from 'react';
3
- import { useDeepCompare } from '../use-deep-compare/index.js';
4
-
5
- function useDeepMemo(factory, dependencies) {
6
- return useMemo(factory, useDeepCompare(dependencies));
1
+ import { useMemo as r } from "react";
2
+ import { useDeepCompare as m } from "../use-deep-compare/index.js";
3
+ function u(e, o) {
4
+ return r(e, m(o));
7
5
  }
8
-
9
- export { useDeepMemo };
6
+ export {
7
+ u as useDeepMemo
8
+ };
@@ -1,18 +1,16 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useLatest } from '../use-latest/index.js';
3
- import { useShallowEffect } from '../use-shallow-effect/index.js';
4
-
5
- function useDocumentEvent(type, listener, options) {
6
- const listenerFn = useLatest(listener);
7
- useShallowEffect(() => {
8
- function handleEvent(event) {
9
- listenerFn.current.call(this, event);
1
+ import { useLatest as o } from "../use-latest/index.js";
2
+ import { useShallowEffect as m } from "../use-shallow-effect/index.js";
3
+ function i(e, u, t) {
4
+ const n = o(u);
5
+ m(() => {
6
+ function r(c) {
7
+ n.current.call(this, c);
10
8
  }
11
- document.addEventListener(type, handleEvent, options);
12
- return () => {
13
- document.removeEventListener(type, handleEvent, options);
9
+ return document.addEventListener(e, r, t), () => {
10
+ document.removeEventListener(e, r, t);
14
11
  };
15
- }, [type, options, listenerFn]);
12
+ }, [e, t, n]);
16
13
  }
17
-
18
- export { useDocumentEvent };
14
+ export {
15
+ i as useDocumentEvent
16
+ };
@@ -1,18 +1,17 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import '@vef-framework/shared';
3
- import { useEffectEvent, useEffect } from 'react';
4
-
5
- function useEmitterEvent(emitter, eventType, eventListener) {
6
- const listenerFn = useEffectEvent(eventListener);
7
- useEffect(
1
+ import "@vef-framework/shared";
2
+ import { useEffectEvent as s, useEffect as c } from "react";
3
+ function i(t, n, e) {
4
+ const o = s(e);
5
+ c(
8
6
  () => {
9
- const handler = (...args) => {
10
- listenerFn(...args);
7
+ const r = (...f) => {
8
+ o(...f);
11
9
  };
12
- return emitter.on(eventType, handler);
10
+ return t.on(n, r);
13
11
  },
14
- [emitter, eventType]
12
+ [t, n]
15
13
  );
16
14
  }
17
-
18
- export { useEmitterEvent };
15
+ export {
16
+ i as useEmitterEvent
17
+ };
@@ -1,13 +1,11 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useIsFetching } from '@vef-framework/core';
3
-
4
- function useHasFetching(key, params) {
5
- const count = useIsFetching({
6
- queryKey: params ? [key, params] : [key],
7
- exact: false,
1
+ import { useIsFetching as c } from "@vef-framework/core";
2
+ function u(t, e) {
3
+ return c({
4
+ queryKey: e ? [t, e] : [t],
5
+ exact: !1,
8
6
  type: "active"
9
- });
10
- return count > 0;
7
+ }) > 0;
11
8
  }
12
-
13
- export { useHasFetching };
9
+ export {
10
+ u as useHasFetching
11
+ };
@@ -1,12 +1,10 @@
1
- /*! @vef-framework/hooks v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:15.845Z */
2
- import { useIsMutating } from '@vef-framework/core';
3
-
4
- function useHasMutating(key) {
5
- const count = useIsMutating({
6
- mutationKey: [key],
7
- exact: false
8
- });
9
- return count > 0;
1
+ import { useIsMutating as n } from "@vef-framework/core";
2
+ function e(t) {
3
+ return n({
4
+ mutationKey: [t],
5
+ exact: !1
6
+ }) > 0;
10
7
  }
11
-
12
- export { useHasMutating };
8
+ export {
9
+ e as useHasMutating
10
+ };