@cyclone-ui/state 0.0.25 → 0.0.26
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/CHANGELOG.md +10 -0
- package/dist/base/atoms/atom-with-broadcast.cjs +1 -2
- package/dist/base/atoms/atom-with-broadcast.d.cts +0 -2
- package/dist/base/atoms/atom-with-broadcast.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-broadcast.d.mts +0 -2
- package/dist/base/atoms/atom-with-broadcast.mjs +1 -2
- package/dist/base/atoms/atom-with-compare.cjs +1 -2
- package/dist/base/atoms/atom-with-compare.d.cts +0 -2
- package/dist/base/atoms/atom-with-compare.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-compare.d.mts +0 -2
- package/dist/base/atoms/atom-with-compare.mjs +1 -2
- package/dist/base/atoms/atom-with-debounce.cjs +1 -2
- package/dist/base/atoms/atom-with-debounce.d.cts +0 -2
- package/dist/base/atoms/atom-with-debounce.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-debounce.d.mts +0 -2
- package/dist/base/atoms/atom-with-debounce.mjs +1 -2
- package/dist/base/atoms/atom-with-effect.cjs +1 -2
- package/dist/base/atoms/atom-with-effect.d.cts +0 -2
- package/dist/base/atoms/atom-with-effect.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-effect.d.mts +0 -2
- package/dist/base/atoms/atom-with-effect.mjs +1 -2
- package/dist/base/atoms/atom-with-listeners.cjs +1 -2
- package/dist/base/atoms/atom-with-listeners.d.cts +0 -2
- package/dist/base/atoms/atom-with-listeners.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-listeners.d.mts +0 -2
- package/dist/base/atoms/atom-with-listeners.mjs +1 -2
- package/dist/base/atoms/atom-with-pending.cjs +1 -2
- package/dist/base/atoms/atom-with-pending.d.cts +0 -2
- package/dist/base/atoms/atom-with-pending.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-pending.d.mts +0 -2
- package/dist/base/atoms/atom-with-pending.mjs +1 -2
- package/dist/base/atoms/atom-with-refresh-and-default.cjs +1 -2
- package/dist/base/atoms/atom-with-refresh-and-default.d.cts +0 -2
- package/dist/base/atoms/atom-with-refresh-and-default.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-refresh-and-default.d.mts +0 -2
- package/dist/base/atoms/atom-with-refresh-and-default.mjs +1 -2
- package/dist/base/atoms/atom-with-refresh.cjs +1 -2
- package/dist/base/atoms/atom-with-refresh.d.cts +0 -2
- package/dist/base/atoms/atom-with-refresh.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-refresh.d.mts +0 -2
- package/dist/base/atoms/atom-with-refresh.mjs +1 -2
- package/dist/base/atoms/atom-with-toggle.cjs +1 -2
- package/dist/base/atoms/atom-with-toggle.d.cts +0 -2
- package/dist/base/atoms/atom-with-toggle.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-toggle.d.mts +0 -2
- package/dist/base/atoms/atom-with-toggle.mjs +1 -2
- package/dist/base/atoms/atom-with-web-storage.cjs +1 -2
- package/dist/base/atoms/atom-with-web-storage.d.cts +0 -2
- package/dist/base/atoms/atom-with-web-storage.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-web-storage.d.mts +0 -2
- package/dist/base/atoms/atom-with-web-storage.mjs +1 -2
- package/dist/base/atoms/atom-with-wrapper.cjs +1 -2
- package/dist/base/atoms/atom-with-wrapper.d.cts +0 -2
- package/dist/base/atoms/atom-with-wrapper.d.cts.map +1 -1
- package/dist/base/atoms/atom-with-wrapper.d.mts +0 -2
- package/dist/base/atoms/atom-with-wrapper.mjs +1 -2
- package/dist/base/atoms/base-atom.cjs +1 -2
- package/dist/base/atoms/base-atom.mjs +1 -2
- package/dist/base/hooks/use-atom-effect.cjs +1 -2
- package/dist/base/hooks/use-atom-effect.d.cts +0 -2
- package/dist/base/hooks/use-atom-effect.d.cts.map +1 -1
- package/dist/base/hooks/use-atom-effect.d.mts +0 -2
- package/dist/base/hooks/use-atom-effect.mjs +1 -2
- package/dist/base/hooks/use-hydrate-molecule.cjs +1 -2
- package/dist/base/hooks/use-hydrate-molecule.d.cts +0 -2
- package/dist/base/hooks/use-hydrate-molecule.d.cts.map +1 -1
- package/dist/base/hooks/use-hydrate-molecule.d.mts +0 -2
- package/dist/base/hooks/use-hydrate-molecule.mjs +1 -2
- package/dist/base/hooks/use-prepare-atoms.cjs +1 -2
- package/dist/base/hooks/use-prepare-atoms.d.cts +0 -2
- package/dist/base/hooks/use-prepare-atoms.d.cts.map +1 -1
- package/dist/base/hooks/use-prepare-atoms.d.mts +0 -2
- package/dist/base/hooks/use-prepare-atoms.mjs +1 -2
- package/dist/base/hooks/use-sync-molecule.cjs +1 -2
- package/dist/base/hooks/use-sync-molecule.d.cts +0 -2
- package/dist/base/hooks/use-sync-molecule.d.cts.map +1 -1
- package/dist/base/hooks/use-sync-molecule.d.mts +0 -2
- package/dist/base/hooks/use-sync-molecule.mjs +1 -2
- package/dist/base/utilities/create-molecule.cjs +1 -2
- package/dist/base/utilities/create-molecule.d.cts +0 -2
- package/dist/base/utilities/create-molecule.d.cts.map +1 -1
- package/dist/base/utilities/create-molecule.d.mts +0 -2
- package/dist/base/utilities/create-molecule.mjs +1 -2
- package/dist/base/utilities/create-web-storage.cjs +1 -2
- package/dist/base/utilities/create-web-storage.d.cts +0 -2
- package/dist/base/utilities/create-web-storage.d.cts.map +1 -1
- package/dist/base/utilities/create-web-storage.d.mts +0 -2
- package/dist/base/utilities/create-web-storage.mjs +1 -2
- package/dist/base/utilities/debounce.cjs +1 -2
- package/dist/base/utilities/debounce.d.cts +0 -2
- package/dist/base/utilities/debounce.d.cts.map +1 -1
- package/dist/base/utilities/debounce.d.mts +0 -2
- package/dist/base/utilities/debounce.mjs +1 -2
- package/dist/base/utilities/is-atom.cjs +1 -2
- package/dist/base/utilities/is-atom.mjs +1 -2
- package/dist/base/utilities/set-atom-debug.cjs +1 -2
- package/dist/base/utilities/set-atom-debug.d.cts +0 -2
- package/dist/base/utilities/set-atom-debug.d.cts.map +1 -1
- package/dist/base/utilities/set-atom-debug.d.mts +0 -2
- package/dist/base/utilities/set-atom-debug.mjs +1 -2
- package/dist/form/atoms/atom-with-field.cjs +1 -2
- package/dist/form/atoms/atom-with-field.mjs +1 -2
- package/dist/form/atoms/atom-with-messages.cjs +1 -2
- package/dist/form/atoms/atom-with-messages.mjs +1 -2
- package/dist/form/hooks/use-field-actions.cjs +1 -2
- package/dist/form/hooks/use-field-actions.d.cts +0 -2
- package/dist/form/hooks/use-field-actions.d.cts.map +1 -1
- package/dist/form/hooks/use-field-actions.d.mts +0 -2
- package/dist/form/hooks/use-field-actions.mjs +1 -2
- package/dist/form/hooks/use-field-ref.cjs +1 -2
- package/dist/form/hooks/use-field-ref.d.cts +0 -2
- package/dist/form/hooks/use-field-ref.d.cts.map +1 -1
- package/dist/form/hooks/use-field-ref.d.mts +0 -2
- package/dist/form/hooks/use-field-ref.mjs +1 -2
- package/dist/form/hooks/use-form-actions.cjs +1 -2
- package/dist/form/hooks/use-form-actions.d.cts +0 -2
- package/dist/form/hooks/use-form-actions.d.cts.map +1 -1
- package/dist/form/hooks/use-form-actions.d.mts +0 -2
- package/dist/form/hooks/use-form-actions.mjs +1 -2
- package/dist/form/molecules/field-molecule.cjs +1 -2
- package/dist/form/molecules/field-molecule.d.cts +0 -2
- package/dist/form/molecules/field-molecule.d.cts.map +1 -1
- package/dist/form/molecules/field-molecule.d.mts +0 -2
- package/dist/form/molecules/field-molecule.mjs +1 -2
- package/dist/form/molecules/form-molecule.cjs +1 -2
- package/dist/form/molecules/form-molecule.d.cts +0 -2
- package/dist/form/molecules/form-molecule.d.cts.map +1 -1
- package/dist/form/molecules/form-molecule.d.mts +0 -2
- package/dist/form/molecules/form-molecule.mjs +1 -2
- package/dist/form/providers/FieldProvider.cjs +1 -2
- package/dist/form/providers/FieldProvider.d.cts +0 -2
- package/dist/form/providers/FieldProvider.d.cts.map +1 -1
- package/dist/form/providers/FieldProvider.d.mts +0 -2
- package/dist/form/providers/FieldProvider.mjs +1 -2
- package/dist/form/providers/FormProvider.cjs +1 -2
- package/dist/form/providers/FormProvider.d.cts +0 -2
- package/dist/form/providers/FormProvider.d.cts.map +1 -1
- package/dist/form/providers/FormProvider.d.mts +0 -2
- package/dist/form/providers/FormProvider.mjs +1 -2
- package/dist/form/types.cjs +1 -2
- package/dist/form/types.d.cts +0 -2
- package/dist/form/types.d.cts.map +1 -1
- package/dist/form/types.d.mts +0 -2
- package/dist/form/types.mjs +1 -2
- package/dist/form/utilities/abort-error.cjs +1 -2
- package/dist/form/utilities/abort-error.d.cts +0 -2
- package/dist/form/utilities/abort-error.d.cts.map +1 -1
- package/dist/form/utilities/abort-error.d.mts +0 -2
- package/dist/form/utilities/abort-error.mjs +1 -2
- package/dist/form/utilities/is-validation-results.cjs +1 -2
- package/dist/form/utilities/is-validation-results.d.cts +0 -2
- package/dist/form/utilities/is-validation-results.d.cts.map +1 -1
- package/dist/form/utilities/is-validation-results.d.mts +0 -2
- package/dist/form/utilities/is-validation-results.mjs +1 -2
- package/dist/form/utilities/validators.cjs +1 -2
- package/dist/form/utilities/validators.d.cts +0 -2
- package/dist/form/utilities/validators.d.cts.map +1 -1
- package/dist/form/utilities/validators.d.mts +0 -2
- package/dist/form/utilities/validators.mjs +1 -2
- package/dist/message/components/MessageViewport.cjs +1 -2
- package/dist/message/components/MessageViewport.d.cts +0 -2
- package/dist/message/components/MessageViewport.d.cts.map +1 -1
- package/dist/message/components/MessageViewport.d.mts +0 -2
- package/dist/message/components/MessageViewport.mjs +1 -2
- package/dist/message/hooks/use-message-actions.cjs +1 -2
- package/dist/message/hooks/use-message-actions.d.cts +0 -2
- package/dist/message/hooks/use-message-actions.d.cts.map +1 -1
- package/dist/message/hooks/use-message-actions.d.mts +0 -2
- package/dist/message/hooks/use-message-actions.mjs +1 -2
- package/dist/message/providers/MessageProvider.cjs +1 -2
- package/dist/message/providers/MessageProvider.d.cts +0 -2
- package/dist/message/providers/MessageProvider.d.cts.map +1 -1
- package/dist/message/providers/MessageProvider.d.mts +0 -2
- package/dist/message/providers/MessageProvider.mjs +1 -2
- package/dist/message/types.d.cts +0 -2
- package/dist/message/types.d.cts.map +1 -1
- package/dist/message/types.d.mts +0 -2
- package/dist/theme/hooks/use-theme-actions.cjs +1 -2
- package/dist/theme/hooks/use-theme-actions.d.cts +0 -2
- package/dist/theme/hooks/use-theme-actions.d.cts.map +1 -1
- package/dist/theme/hooks/use-theme-actions.d.mts +0 -2
- package/dist/theme/hooks/use-theme-actions.mjs +1 -2
- package/dist/theme/hooks/use-theme-store.cjs +1 -2
- package/dist/theme/hooks/use-theme-store.d.cts +0 -2
- package/dist/theme/hooks/use-theme-store.d.cts.map +1 -1
- package/dist/theme/hooks/use-theme-store.d.mts +0 -2
- package/dist/theme/hooks/use-theme-store.mjs +1 -2
- package/dist/theme/molecules/theme-molecule.cjs +1 -2
- package/dist/theme/molecules/theme-molecule.d.cts +0 -2
- package/dist/theme/molecules/theme-molecule.d.cts.map +1 -1
- package/dist/theme/molecules/theme-molecule.d.mts +0 -2
- package/dist/theme/molecules/theme-molecule.mjs +1 -2
- package/dist/theme/providers/ThemeProvider.cjs +1 -2
- package/dist/theme/providers/ThemeProvider.d.cts +0 -2
- package/dist/theme/providers/ThemeProvider.d.cts.map +1 -1
- package/dist/theme/providers/ThemeProvider.d.mts +0 -2
- package/dist/theme/providers/ThemeProvider.mjs +1 -2
- package/dist/theme/types.d.cts +0 -2
- package/dist/theme/types.d.cts.map +1 -1
- package/dist/theme/types.d.mts +0 -2
- package/dist/theme/utilities/theme-helpers.cjs +1 -2
- package/dist/theme/utilities/theme-helpers.d.cts +0 -2
- package/dist/theme/utilities/theme-helpers.d.cts.map +1 -1
- package/dist/theme/utilities/theme-helpers.d.mts +0 -2
- package/dist/theme/utilities/theme-helpers.mjs +1 -2
- package/dist/types.d.cts +0 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +0 -2
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_base_atom = require("./base-atom.cjs");
|
|
2
2
|
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/atoms/atom-with-wrapper.ts
|
|
5
5
|
const wrapFn = (fnOrValue) => (0, _stryke_type_checks_is_function.isFunction)(fnOrValue) ? { __fn: fnOrValue } : fnOrValue;
|
|
6
6
|
const unwrapFn = (wrappedFnOrValue) => wrappedFnOrValue && typeof wrappedFnOrValue === "object" && "__fn" in wrappedFnOrValue ? wrappedFnOrValue.__fn : wrappedFnOrValue;
|
|
7
7
|
/**
|
|
@@ -21,5 +21,4 @@ const atomWithWrapper = (initialValue) => {
|
|
|
21
21
|
return require_base_atom.baseAtom((get) => unwrapFn(get(rootAtom)), (_get, set, value) => set(rootAtom, wrapFn(value)));
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
exports.atomWithWrapper = atomWithWrapper;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WritableAtom } from "jotai";
|
|
2
|
-
//#region src/base/atoms/atom-with-wrapper.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create an atom with a wrapper that allows functions as values.
|
|
5
4
|
*
|
|
@@ -13,6 +12,5 @@ import { WritableAtom } from "jotai";
|
|
|
13
12
|
* @returns An atom with a wrapper that allows functions as values.
|
|
14
13
|
*/
|
|
15
14
|
declare const atomWithWrapper: <TValue>(initialValue: TValue) => WritableAtom<TValue, [TValue], Promise<void> | void>;
|
|
16
|
-
//#endregion
|
|
17
15
|
export { atomWithWrapper };
|
|
18
16
|
//# sourceMappingURL=atom-with-wrapper.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atom-with-wrapper.d.cts","names":[],"sources":["../../../src/base/atoms/atom-with-wrapper.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"atom-with-wrapper.d.cts","names":[],"sources":["../../../src/base/atoms/atom-with-wrapper.ts"],"mappings":";;;;;;;;;;;;;cAiDa,kBAAmB,QAC9B,cAAc,WACb,aAAa,SAAS,SAAS"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WritableAtom } from "jotai";
|
|
2
|
-
//#region src/base/atoms/atom-with-wrapper.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create an atom with a wrapper that allows functions as values.
|
|
5
4
|
*
|
|
@@ -13,6 +12,5 @@ import { WritableAtom } from "jotai";
|
|
|
13
12
|
* @returns An atom with a wrapper that allows functions as values.
|
|
14
13
|
*/
|
|
15
14
|
declare const atomWithWrapper: <TValue>(initialValue: TValue) => WritableAtom<TValue, [TValue], Promise<void> | void>;
|
|
16
|
-
//#endregion
|
|
17
15
|
export { atomWithWrapper };
|
|
18
16
|
//# sourceMappingURL=atom-with-wrapper.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { baseAtom } from "./base-atom.mjs";
|
|
2
2
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/atoms/atom-with-wrapper.ts
|
|
5
5
|
const wrapFn = (fnOrValue) => isFunction(fnOrValue) ? { __fn: fnOrValue } : fnOrValue;
|
|
6
6
|
const unwrapFn = (wrappedFnOrValue) => wrappedFnOrValue && typeof wrappedFnOrValue === "object" && "__fn" in wrappedFnOrValue ? wrappedFnOrValue.__fn : wrappedFnOrValue;
|
|
7
7
|
/**
|
|
@@ -21,6 +21,5 @@ const atomWithWrapper = (initialValue) => {
|
|
|
21
21
|
return baseAtom((get) => unwrapFn(get(rootAtom)), (_get, set, value) => set(rootAtom, wrapFn(value)));
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { atomWithWrapper };
|
|
26
25
|
//# sourceMappingURL=atom-with-wrapper.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_set_atom_debug = require("../utilities/set-atom-debug.cjs");
|
|
2
2
|
let jotai_vanilla = require("jotai/vanilla");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/atoms/base-atom.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a "base" atom that can be used to create derived atoms.
|
|
7
7
|
* The base atom is a writable atom that can be used to create derived atoms.
|
|
@@ -21,5 +21,4 @@ function baseAtom(readOrInitialValue, write) {
|
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
exports.baseAtom = baseAtom;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setAtomDebugLabel } from "../utilities/set-atom-debug.mjs";
|
|
2
2
|
import { atom } from "jotai/vanilla";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/atoms/base-atom.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a "base" atom that can be used to create derived atoms.
|
|
7
7
|
* The base atom is a writable atom that can be used to create derived atoms.
|
|
@@ -21,6 +21,5 @@ function baseAtom(readOrInitialValue, write) {
|
|
|
21
21
|
return result;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { baseAtom };
|
|
26
25
|
//# sourceMappingURL=base-atom.mjs.map
|
|
@@ -3,7 +3,7 @@ let jotai_utils = require("jotai/utils");
|
|
|
3
3
|
let _stryke_hooks_use_memo_stable = require("@stryke/hooks/use-memo-stable");
|
|
4
4
|
let jotai_react = require("jotai/react");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/base/hooks/use-atom-effect.ts
|
|
7
7
|
/**
|
|
8
8
|
* A hook that runs a side effect when the component mounts.
|
|
9
9
|
*
|
|
@@ -13,5 +13,4 @@ function useAtomEffect(effectFn, deps = []) {
|
|
|
13
13
|
(0, jotai_react.useAtomValue)((0, jotai_utils.loadable)((0, _stryke_hooks_use_memo_stable.useMemoStable)(() => require_atom_with_effect.atomWithEffect(effectFn), deps)));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
exports.useAtomEffect = useAtomEffect;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { EffectCallback } from "../atoms/atom-with-effect.cjs";
|
|
2
|
-
//#region src/base/hooks/use-atom-effect.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A hook that runs a side effect when the component mounts.
|
|
5
4
|
*
|
|
6
5
|
* @param effectFn - The side effect function.
|
|
7
6
|
*/
|
|
8
7
|
declare function useAtomEffect(effectFn: EffectCallback, deps?: any[]): void;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { useAtomEffect };
|
|
11
9
|
//# sourceMappingURL=use-atom-effect.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-atom-effect.d.cts","names":[],"sources":["../../../src/base/hooks/use-atom-effect.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-atom-effect.d.cts","names":[],"sources":["../../../src/base/hooks/use-atom-effect.ts"],"mappings":";;;;;;iBA6BgB,cAAc,UAAU,gBAAgB"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { EffectCallback } from "../atoms/atom-with-effect.mjs";
|
|
2
|
-
//#region src/base/hooks/use-atom-effect.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* A hook that runs a side effect when the component mounts.
|
|
5
4
|
*
|
|
6
5
|
* @param effectFn - The side effect function.
|
|
7
6
|
*/
|
|
8
7
|
declare function useAtomEffect(effectFn: EffectCallback, deps?: any[]): void;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { useAtomEffect };
|
|
11
9
|
//# sourceMappingURL=use-atom-effect.d.mts.map
|
|
@@ -3,7 +3,7 @@ import { loadable } from "jotai/utils";
|
|
|
3
3
|
import { useMemoStable } from "@stryke/hooks/use-memo-stable";
|
|
4
4
|
import { useAtomValue } from "jotai/react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/base/hooks/use-atom-effect.ts
|
|
7
7
|
/**
|
|
8
8
|
* A hook that runs a side effect when the component mounts.
|
|
9
9
|
*
|
|
@@ -13,6 +13,5 @@ function useAtomEffect(effectFn, deps = []) {
|
|
|
13
13
|
useAtomValue(loadable(useMemoStable(() => atomWithEffect(effectFn), deps)));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { useAtomEffect };
|
|
18
17
|
//# sourceMappingURL=use-atom-effect.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let jotai_utils = require("jotai/utils");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/base/hooks/use-hydrate-molecule.ts
|
|
4
4
|
/**
|
|
5
5
|
* Hydrate atoms with initial values for SSR.
|
|
6
6
|
*/
|
|
@@ -13,5 +13,4 @@ const useHydrateMolecule = (atoms, initialValues, store) => {
|
|
|
13
13
|
(0, jotai_utils.useHydrateAtoms)(values, { store });
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
exports.useHydrateMolecule = useHydrateMolecule;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { JotaiStore, WritableAtomRecord } from "../../types.cjs";
|
|
2
2
|
import { useHydrateAtoms } from "jotai/utils";
|
|
3
|
-
//#region src/base/hooks/use-hydrate-molecule.d.ts
|
|
4
3
|
type UseHydrateAtoms<T> = (initialValues: Partial<Record<keyof T, any>>, options?: Parameters<typeof useHydrateAtoms>[1]) => void;
|
|
5
4
|
/**
|
|
6
5
|
* Hydrate atoms with initial values for SSR.
|
|
7
6
|
*/
|
|
8
7
|
declare const useHydrateMolecule: <T extends object>(atoms: WritableAtomRecord<T>, initialValues: Partial<Record<keyof T, unknown>>, store?: JotaiStore) => void;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { UseHydrateAtoms, useHydrateMolecule };
|
|
11
9
|
//# sourceMappingURL=use-hydrate-molecule.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hydrate-molecule.d.cts","names":[],"sources":["../../../src/base/hooks/use-hydrate-molecule.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-hydrate-molecule.d.cts","names":[],"sources":["../../../src/base/hooks/use-hydrate-molecule.ts"],"mappings":";;KAsBY,gBAAgB,MAC1B,eAAe,QAAQ,aAAa,UACpC,UAAU,kBAAkB;;;;cAMjB,qBAAsB,kBACjC,OAAO,mBAAmB,IAC1B,eAAe,QAAQ,aAAa,cACpC,QAAQ"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { JotaiStore, WritableAtomRecord } from "../../types.mjs";
|
|
2
2
|
import { useHydrateAtoms } from "jotai/utils";
|
|
3
|
-
//#region src/base/hooks/use-hydrate-molecule.d.ts
|
|
4
3
|
type UseHydrateAtoms<T> = (initialValues: Partial<Record<keyof T, any>>, options?: Parameters<typeof useHydrateAtoms>[1]) => void;
|
|
5
4
|
/**
|
|
6
5
|
* Hydrate atoms with initial values for SSR.
|
|
7
6
|
*/
|
|
8
7
|
declare const useHydrateMolecule: <T extends object>(atoms: WritableAtomRecord<T>, initialValues: Partial<Record<keyof T, unknown>>, store?: JotaiStore) => void;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { UseHydrateAtoms, useHydrateMolecule };
|
|
11
9
|
//# sourceMappingURL=use-hydrate-molecule.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useHydrateAtoms } from "jotai/utils";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/base/hooks/use-hydrate-molecule.ts
|
|
4
4
|
/**
|
|
5
5
|
* Hydrate atoms with initial values for SSR.
|
|
6
6
|
*/
|
|
@@ -13,6 +13,5 @@ const useHydrateMolecule = (atoms, initialValues, store) => {
|
|
|
13
13
|
useHydrateAtoms(values, { store });
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { useHydrateMolecule };
|
|
18
17
|
//# sourceMappingURL=use-hydrate-molecule.mjs.map
|
|
@@ -2,7 +2,7 @@ let jotai_vanilla = require("jotai/vanilla");
|
|
|
2
2
|
let react = require("react");
|
|
3
3
|
let jotai_react = require("jotai/react");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/base/hooks/use-prepare-atoms.ts
|
|
6
6
|
function useMemoList(list, compareFn = (a, b) => a === b) {
|
|
7
7
|
const [state, setState] = (0, react.useState)(list);
|
|
8
8
|
const listChanged = list.length !== state.length || list.some((arg, index) => !compareFn(arg, state[index]));
|
|
@@ -16,5 +16,4 @@ function usePrepareAtoms(atoms, options) {
|
|
|
16
16
|
}), [stableAtoms]), options);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.usePrepareAtoms = usePrepareAtoms;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Atom } from "jotai/vanilla";
|
|
2
2
|
import { useAtomValue } from "jotai/react";
|
|
3
|
-
//#region src/base/hooks/use-prepare-atoms.d.ts
|
|
4
3
|
type Options = Parameters<typeof useAtomValue>[1];
|
|
5
4
|
declare function usePrepareAtoms(atoms: Atom<unknown>[], options?: Options): void;
|
|
6
|
-
//#endregion
|
|
7
5
|
export { usePrepareAtoms };
|
|
8
6
|
//# sourceMappingURL=use-prepare-atoms.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-prepare-atoms.d.cts","names":[],"sources":["../../../src/base/hooks/use-prepare-atoms.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-prepare-atoms.d.cts","names":[],"sources":["../../../src/base/hooks/use-prepare-atoms.ts"],"mappings":";;KAmCK,UAAU,kBAAkB;iBAEjB,gBAAgB,OAAO,iBAAiB,UAAU"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Atom } from "jotai/vanilla";
|
|
2
2
|
import { useAtomValue } from "jotai/react";
|
|
3
|
-
//#region src/base/hooks/use-prepare-atoms.d.ts
|
|
4
3
|
type Options = Parameters<typeof useAtomValue>[1];
|
|
5
4
|
declare function usePrepareAtoms(atoms: Atom<unknown>[], options?: Options): void;
|
|
6
|
-
//#endregion
|
|
7
5
|
export { usePrepareAtoms };
|
|
8
6
|
//# sourceMappingURL=use-prepare-atoms.d.mts.map
|
|
@@ -2,7 +2,7 @@ import { atom } from "jotai/vanilla";
|
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
3
|
import { useAtomValue } from "jotai/react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/base/hooks/use-prepare-atoms.ts
|
|
6
6
|
function useMemoList(list, compareFn = (a, b) => a === b) {
|
|
7
7
|
const [state, setState] = useState(list);
|
|
8
8
|
const listChanged = list.length !== state.length || list.some((arg, index) => !compareFn(arg, state[index]));
|
|
@@ -16,6 +16,5 @@ function usePrepareAtoms(atoms, options) {
|
|
|
16
16
|
}), [stableAtoms]), options);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
export { usePrepareAtoms };
|
|
21
20
|
//# sourceMappingURL=use-prepare-atoms.mjs.map
|
|
@@ -3,7 +3,7 @@ let _stryke_helpers_is_equal = require("@stryke/helpers/is-equal");
|
|
|
3
3
|
let jotai = require("jotai");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/base/hooks/use-sync-molecule.ts
|
|
7
7
|
/**
|
|
8
8
|
* Keep the previous reference while `value` is deeply equal to it, so callers
|
|
9
9
|
* passing a fresh object literal each render do not re-trigger effects.
|
|
@@ -33,5 +33,4 @@ const useSyncMolecule = (atoms, values, store) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
exports.useSyncMolecule = useSyncMolecule;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JotaiStore, WritableAtomRecord } from "../../types.cjs";
|
|
2
|
-
//#region src/base/hooks/use-sync-molecule.d.ts
|
|
3
2
|
type UseSyncAtoms<T> = (values: Partial<Record<keyof T, any>>, store?: JotaiStore) => void;
|
|
4
3
|
/**
|
|
5
4
|
* Update atoms with new values on changes.
|
|
@@ -10,6 +9,5 @@ type UseSyncAtoms<T> = (values: Partial<Record<keyof T, any>>, store?: JotaiStor
|
|
|
10
9
|
* providers sharing a molecule scope overwrite each other on every render.
|
|
11
10
|
*/
|
|
12
11
|
declare const useSyncMolecule: <T extends object>(atoms: WritableAtomRecord<T>, values: Partial<Record<keyof T, unknown>>, store?: JotaiStore) => void;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { UseSyncAtoms, useSyncMolecule };
|
|
15
13
|
//# sourceMappingURL=use-sync-molecule.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-molecule.d.cts","names":[],"sources":["../../../src/base/hooks/use-sync-molecule.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-sync-molecule.d.cts","names":[],"sources":["../../../src/base/hooks/use-sync-molecule.ts"],"mappings":";KA6BY,aAAa,MACvB,QAAQ,QAAQ,aAAa,UAC7B,QAAQ;;;;;;;;;cAwBG,kBAAmB,kBAC9B,OAAO,mBAAmB,IAC1B,QAAQ,QAAQ,aAAa,cAC7B,QAAQ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JotaiStore, WritableAtomRecord } from "../../types.mjs";
|
|
2
|
-
//#region src/base/hooks/use-sync-molecule.d.ts
|
|
3
2
|
type UseSyncAtoms<T> = (values: Partial<Record<keyof T, any>>, store?: JotaiStore) => void;
|
|
4
3
|
/**
|
|
5
4
|
* Update atoms with new values on changes.
|
|
@@ -10,6 +9,5 @@ type UseSyncAtoms<T> = (values: Partial<Record<keyof T, any>>, store?: JotaiStor
|
|
|
10
9
|
* providers sharing a molecule scope overwrite each other on every render.
|
|
11
10
|
*/
|
|
12
11
|
declare const useSyncMolecule: <T extends object>(atoms: WritableAtomRecord<T>, values: Partial<Record<keyof T, unknown>>, store?: JotaiStore) => void;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { UseSyncAtoms, useSyncMolecule };
|
|
15
13
|
//# sourceMappingURL=use-sync-molecule.d.mts.map
|
|
@@ -3,7 +3,7 @@ import { isEqual } from "@stryke/helpers/is-equal";
|
|
|
3
3
|
import { useAtomValue, useSetAtom } from "jotai";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/base/hooks/use-sync-molecule.ts
|
|
7
7
|
/**
|
|
8
8
|
* Keep the previous reference while `value` is deeply equal to it, so callers
|
|
9
9
|
* passing a fresh object literal each render do not re-trigger effects.
|
|
@@ -33,6 +33,5 @@ const useSyncMolecule = (atoms, values, store) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
export { useSyncMolecule };
|
|
38
37
|
//# sourceMappingURL=use-sync-molecule.mjs.map
|
|
@@ -10,7 +10,7 @@ let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
|
10
10
|
let bunshi = require("bunshi");
|
|
11
11
|
let Bunshi_react = require("bunshi/react");
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/base/utilities/create-molecule.tsx
|
|
14
14
|
const DEFAULT_SCOPE = "__global__";
|
|
15
15
|
/**
|
|
16
16
|
* Create a new Scope with the given default value.
|
|
@@ -98,7 +98,6 @@ function createMoleculeApi(constructFn, options) {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
//#endregion
|
|
102
101
|
exports.DEFAULT_SCOPE = DEFAULT_SCOPE;
|
|
103
102
|
exports.createMoleculeApi = createMoleculeApi;
|
|
104
103
|
exports.createScope = createScope;
|
|
@@ -2,7 +2,6 @@ import { AtomRecord, AtomRecordConstraint, ExtractAtomRecordValues, IsResetAtom
|
|
|
2
2
|
import { MoleculeScope } from "bunshi";
|
|
3
3
|
import { MoleculeScopeOptions, ProviderProps } from "bunshi/react";
|
|
4
4
|
import { Atom, WritableAtom } from "jotai";
|
|
5
|
-
//#region src/base/utilities/create-molecule.d.ts
|
|
6
5
|
type Molecule<TValue> = {
|
|
7
6
|
displayName?: string;
|
|
8
7
|
} & Record<symbol, unknown>;
|
|
@@ -63,6 +62,5 @@ interface MoleculeOptions<TState extends AtomRecordConstraint<TState> = AtomReco
|
|
|
63
62
|
* @returns The new Molecule.
|
|
64
63
|
*/
|
|
65
64
|
declare function createMoleculeApi<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint>(constructFn: (scope: string) => TState, options: MoleculeOptions<TState>): MoleculeApi<TState>;
|
|
66
|
-
//#endregion
|
|
67
65
|
export { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions$1 as MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope, use };
|
|
68
66
|
//# sourceMappingURL=create-molecule.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-molecule.d.cts","names":["MoleculeScopeOptions","MoleculeScopeOptionsBase"],"sources":["../../../src/base/utilities/create-molecule.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-molecule.d.cts","names":["MoleculeScopeOptions","MoleculeScopeOptionsBase"],"sources":["../../../src/base/utilities/create-molecule.tsx"],"mappings":";;;;KAqDY,SAAS;EACnB;IACE;KAEQ,oBAAoB;EAC9B;EACA;;KAGU,cACV,eAAe,qBAAqB,UAAU,wBAC5C,oBAAoB;cAEX;;;;;;;;iBASG,YACd,uBACA;EACE;IACD;;;;;;;iBAWa,IAAI,QAClB,YAAY,SAAS,UAAU,cAAc,UAC5C;KAIE,iBACH,eAAe,qBAAqB,UAAU,2BAE7C,cAAc;EACb,KAAK,OAAO,cAAc,WAAW,WAChC,OAAOA,2BAAyB;EAErC,KAAK,OAAO,cAAc,mBAClB,eACA,aACA,YAEH,OAAOA,+BAA6B,MAAM,UAAU;EAEzD,OAAO,YAAY,OAAO,uBACrB,OAAOA;;KAKJA,yBAAuBC;UAElB,YACf,eAAe,qBAAqB,UAAU;EAE9C,UAAU,SAAS,cAAc;EACjC,UAAU,MAAM,GAAG,sBAAsB;EACzC,OAAO;EACP,cAAc,OAAOD,2BAAyB,cAAc;EAC5D,MAAM,OAAOA,2BAAyB,iBAAiB;;KAG7C,iBAAiB,qBAAqB,oBAChD,WAAW;KAED,sBACV,eAAe,qBAAqB,UAAU,wBAC5C,KAAK;EACP;EACA,eAAe,QAAQ,wBAAwB;;KAGrC;KACA,cACV,eAAe,qBAAqB,UAAU,yBAC3C,OAAO,cAAc,YAAY;UAErB,gBACf,eAAe,qBAAqB,UAAU;EAE9C;EACA,QAAQ;EACR,UAAU,cAAc;EACxB,YAAY;;;;;;;;;iBAUE,kBACd,eAAe,qBAAqB,UAAU,sBAE9C,cAAc,kBAAkB,QAChC,SAAS,gBAAgB,UACxB,YAAY"}
|
|
@@ -2,7 +2,6 @@ import { AtomRecord, AtomRecordConstraint, ExtractAtomRecordValues, IsResetAtom
|
|
|
2
2
|
import { Atom, WritableAtom } from "jotai";
|
|
3
3
|
import { MoleculeScope } from "bunshi";
|
|
4
4
|
import { MoleculeScopeOptions, ProviderProps } from "bunshi/react";
|
|
5
|
-
//#region src/base/utilities/create-molecule.d.ts
|
|
6
5
|
type Molecule<TValue> = {
|
|
7
6
|
displayName?: string;
|
|
8
7
|
} & Record<symbol, unknown>;
|
|
@@ -63,6 +62,5 @@ interface MoleculeOptions<TState extends AtomRecordConstraint<TState> = AtomReco
|
|
|
63
62
|
* @returns The new Molecule.
|
|
64
63
|
*/
|
|
65
64
|
declare function createMoleculeApi<TState extends AtomRecordConstraint<TState> = AtomRecordConstraint>(constructFn: (scope: string) => TState, options: MoleculeOptions<TState>): MoleculeApi<TState>;
|
|
66
|
-
//#endregion
|
|
67
65
|
export { BaseMoleculeState, CleanupCallback, DEFAULT_SCOPE, GetMoleculeState, Molecule, MoleculeApi, MoleculeOptions, MoleculeProviderProps, MoleculeScopeOptions$1 as MoleculeScopeOptions, MoleculeState, MountCallback, createMoleculeApi, createScope$1 as createScope, use$1 as use };
|
|
68
66
|
//# sourceMappingURL=create-molecule.d.mts.map
|
|
@@ -10,7 +10,7 @@ import { isString } from "@stryke/type-checks/is-string";
|
|
|
10
10
|
import { createScope, molecule, onMount, onUnmount, use } from "bunshi";
|
|
11
11
|
import { ScopeProvider, useMolecule } from "bunshi/react";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/base/utilities/create-molecule.tsx
|
|
14
14
|
const DEFAULT_SCOPE = "__global__";
|
|
15
15
|
/**
|
|
16
16
|
* Create a new Scope with the given default value.
|
|
@@ -98,6 +98,5 @@ function createMoleculeApi(constructFn, options) {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
//#endregion
|
|
102
101
|
export { DEFAULT_SCOPE, createMoleculeApi, createScope$1 as createScope, use$1 as use };
|
|
103
102
|
//# sourceMappingURL=create-molecule.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
2
2
|
let _stryke_type_checks_is_promise = require("@stryke/type-checks/is-promise");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/utilities/create-web-storage.ts
|
|
5
5
|
function createWebStorage(getStringStorage) {
|
|
6
6
|
let lastStrValue;
|
|
7
7
|
let lastValue;
|
|
@@ -51,5 +51,4 @@ function createWebStorage(getStringStorage) {
|
|
|
51
51
|
return storage;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
//#endregion
|
|
55
54
|
exports.createWebStorage = createWebStorage;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { AsyncStorage, AsyncStringStorage, SyncStorage, SyncStringStorage } from "jotai/vanilla/utils/atomWithStorage";
|
|
2
|
-
//#region src/base/utilities/create-web-storage.d.ts
|
|
3
2
|
declare function createWebStorage<TValue>(getStringStorage: () => AsyncStringStorage | SyncStringStorage | undefined): AsyncStorage<TValue> | SyncStorage<TValue>;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { createWebStorage };
|
|
6
4
|
//# sourceMappingURL=create-web-storage.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-web-storage.d.cts","names":[],"sources":["../../../src/base/utilities/create-web-storage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-web-storage.d.cts","names":[],"sources":["../../../src/base/utilities/create-web-storage.ts"],"mappings":";iBA2BgB,iBAAiB,QAC/B,wBAAwB,qBAAqB,gCAC5C,aAAa,UAAU,YAAY"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { AsyncStorage, AsyncStringStorage, SyncStorage, SyncStringStorage } from "jotai/vanilla/utils/atomWithStorage";
|
|
2
|
-
//#region src/base/utilities/create-web-storage.d.ts
|
|
3
2
|
declare function createWebStorage<TValue>(getStringStorage: () => AsyncStringStorage | SyncStringStorage | undefined): AsyncStorage<TValue> | SyncStorage<TValue>;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { createWebStorage };
|
|
6
4
|
//# sourceMappingURL=create-web-storage.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StormJSON } from "@stryke/json/storm-json";
|
|
2
2
|
import { isPromise, isPromiseLike } from "@stryke/type-checks/is-promise";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/utilities/create-web-storage.ts
|
|
5
5
|
function createWebStorage(getStringStorage) {
|
|
6
6
|
let lastStrValue;
|
|
7
7
|
let lastValue;
|
|
@@ -51,6 +51,5 @@ function createWebStorage(getStringStorage) {
|
|
|
51
51
|
return storage;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
//#endregion
|
|
55
54
|
export { createWebStorage };
|
|
56
55
|
//# sourceMappingURL=create-web-storage.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/base/utilities/debounce.ts
|
|
2
2
|
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
3
3
|
function debounce(fn, wait = 25, options = {}) {
|
|
4
4
|
options = {
|
|
@@ -48,5 +48,4 @@ async function _applyPromised(fn, _this, args) {
|
|
|
48
48
|
return await fn.apply(_this, args);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
exports.debounce = debounce;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/base/utilities/debounce.d.ts
|
|
2
1
|
interface DebounceOptions {
|
|
3
2
|
/**
|
|
4
3
|
* Call the `fn` on the [leading edge of the timeout](https://css-tricks.com/debouncing-throttling-explained-examples/#article-header-id-1).
|
|
@@ -14,6 +13,5 @@ interface DebounceOptions {
|
|
|
14
13
|
readonly trailing?: boolean;
|
|
15
14
|
}
|
|
16
15
|
declare function debounce<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => PromiseLike<TReturn> | TReturn, wait?: number, options?: DebounceOptions): (...args: TArgs) => Promise<TReturn>;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { DebounceOptions, debounce };
|
|
19
17
|
//# sourceMappingURL=debounce.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.cts","names":[],"sources":["../../../src/base/utilities/debounce.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"debounce.d.cts","names":[],"sources":["../../../src/base/utilities/debounce.ts"],"mappings":"A,UAkBiB;;;;;;;WAON;;;;;WAMA;;iBAOK,SAAS,yBAAyB,SAChD,QAAQ,MAAM,UAAU,YAAY,WAAW,SAC/C,eACA,UAAS,sBAwCQ,MAAM,UAAK,QAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/base/utilities/debounce.d.ts
|
|
2
1
|
interface DebounceOptions {
|
|
3
2
|
/**
|
|
4
3
|
* Call the `fn` on the [leading edge of the timeout](https://css-tricks.com/debouncing-throttling-explained-examples/#article-header-id-1).
|
|
@@ -14,6 +13,5 @@ interface DebounceOptions {
|
|
|
14
13
|
readonly trailing?: boolean;
|
|
15
14
|
}
|
|
16
15
|
declare function debounce<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => PromiseLike<TReturn> | TReturn, wait?: number, options?: DebounceOptions): (...args: TArgs) => Promise<TReturn>;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { DebounceOptions, debounce };
|
|
19
17
|
//# sourceMappingURL=debounce.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/base/utilities/debounce.ts
|
|
2
2
|
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
3
3
|
function debounce(fn, wait = 25, options = {}) {
|
|
4
4
|
options = {
|
|
@@ -48,6 +48,5 @@ async function _applyPromised(fn, _this, args) {
|
|
|
48
48
|
return await fn.apply(_this, args);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
export { debounce };
|
|
53
52
|
//# sourceMappingURL=debounce.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
2
2
|
let _stryke_type_checks_is_plain_object = require("@stryke/type-checks/is-plain-object");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/utilities/is-atom.ts
|
|
5
5
|
/**
|
|
6
6
|
* Check if the value is a [Jotai](https://jotai.org) `Atom` object
|
|
7
7
|
*
|
|
@@ -42,7 +42,6 @@ const isResetAtom = (value) => {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.isAtom = isAtom;
|
|
47
46
|
exports.isResetAtom = isResetAtom;
|
|
48
47
|
exports.isWritableAtom = isWritableAtom;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFunction } from "@stryke/type-checks/is-function";
|
|
2
2
|
import { isPlainObject } from "@stryke/type-checks/is-plain-object";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/base/utilities/is-atom.ts
|
|
5
5
|
/**
|
|
6
6
|
* Check if the value is a [Jotai](https://jotai.org) `Atom` object
|
|
7
7
|
*
|
|
@@ -42,6 +42,5 @@ const isResetAtom = (value) => {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
export { isAtom, isResetAtom, isWritableAtom };
|
|
47
46
|
//# sourceMappingURL=is-atom.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/base/utilities/set-atom-debug.ts
|
|
4
4
|
/**
|
|
5
5
|
* Add a debug label to the Jotai Atom
|
|
6
6
|
*
|
|
@@ -19,6 +19,5 @@ const setAtomDebugPrivate = (atom) => {
|
|
|
19
19
|
if (_stryke_env_environment_checks.isDevelopment) atom.debugPrivate = true;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.setAtomDebugLabel = setAtomDebugLabel;
|
|
24
23
|
exports.setAtomDebugPrivate = setAtomDebugPrivate;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Atom } from "jotai/vanilla";
|
|
2
|
-
//#region src/base/utilities/set-atom-debug.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Add a debug label to the Jotai Atom
|
|
5
4
|
*
|
|
@@ -13,6 +12,5 @@ declare const setAtomDebugLabel: (atom: Atom<unknown>, label: string) => void;
|
|
|
13
12
|
* @param atom - The atom to mark as private
|
|
14
13
|
*/
|
|
15
14
|
declare const setAtomDebugPrivate: (atom: Atom<unknown>) => void;
|
|
16
|
-
//#endregion
|
|
17
15
|
export { setAtomDebugLabel, setAtomDebugPrivate };
|
|
18
16
|
//# sourceMappingURL=set-atom-debug.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-atom-debug.d.cts","names":[],"sources":["../../../src/base/utilities/set-atom-debug.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"set-atom-debug.d.cts","names":[],"sources":["../../../src/base/utilities/set-atom-debug.ts"],"mappings":";;;;;;;cA2Ba,oBAAqB,MAAM,eAAe;;;;;;cAW1C,sBAAuB,MAAM"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Atom } from "jotai/vanilla";
|
|
2
|
-
//#region src/base/utilities/set-atom-debug.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Add a debug label to the Jotai Atom
|
|
5
4
|
*
|
|
@@ -13,6 +12,5 @@ declare const setAtomDebugLabel: (atom: Atom<unknown>, label: string) => void;
|
|
|
13
12
|
* @param atom - The atom to mark as private
|
|
14
13
|
*/
|
|
15
14
|
declare const setAtomDebugPrivate: (atom: Atom<unknown>) => void;
|
|
16
|
-
//#endregion
|
|
17
15
|
export { setAtomDebugLabel, setAtomDebugPrivate };
|
|
18
16
|
//# sourceMappingURL=set-atom-debug.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDevelopment } from "@stryke/env/environment-checks";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/base/utilities/set-atom-debug.ts
|
|
4
4
|
/**
|
|
5
5
|
* Add a debug label to the Jotai Atom
|
|
6
6
|
*
|
|
@@ -19,6 +19,5 @@ const setAtomDebugPrivate = (atom) => {
|
|
|
19
19
|
if (isDevelopment) atom.debugPrivate = true;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { setAtomDebugLabel, setAtomDebugPrivate };
|
|
24
23
|
//# sourceMappingURL=set-atom-debug.mjs.map
|