@snack-uikit/utils 4.0.1 → 4.0.2

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.0.2 (2026-05-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **PDS-3818:** swap places for useDataPersist so that URL > localStorage ([4018a25](https://github.com/cloud-ru-tech/snack-uikit/commit/4018a2536565b8fb85da1f26b22234806812ef56))
12
+
13
+
14
+
15
+
16
+
6
17
  ## <small>4.0.1 (2026-01-19)</small>
7
18
 
8
19
  * chore(FF-6693): tune test configs ([d194f4d](https://github.com/cloud-ru-tech/snack-uikit/commit/d194f4d))
@@ -19,13 +19,13 @@ const useDataPersist = _ref => {
19
19
  getData: getLocalStorageData,
20
20
  setData: setLocalStorageData
21
21
  } = (0, useSource_1.useSource)({
22
- source: querySource
22
+ source: localStorageSource
23
23
  });
24
24
  const {
25
25
  getData: getQueryParamsData,
26
26
  setData: setQueryParamsData
27
27
  } = (0, useSource_1.useSource)({
28
- source: localStorageSource
28
+ source: querySource
29
29
  });
30
30
  const setDataToStorages = (0, react_1.useCallback)(data => {
31
31
  setLocalStorageData(data);
@@ -5,10 +5,10 @@ export const useDataPersist = ({ options, parser, serializer }) => {
5
5
  const querySource = useMemo(() => options ? new QueryParamSource(options.queryKey, options.validateData, parser, serializer) : undefined, [options, parser, serializer]);
6
6
  const localStorageSource = useMemo(() => (options ? new LocalStorageSource(options.localStorageKey, options.validateData) : undefined), [options]);
7
7
  const { getData: getLocalStorageData, setData: setLocalStorageData } = useSource({
8
- source: querySource,
8
+ source: localStorageSource,
9
9
  });
10
10
  const { getData: getQueryParamsData, setData: setQueryParamsData } = useSource({
11
- source: localStorageSource,
11
+ source: querySource,
12
12
  });
13
13
  const setDataToStorages = useCallback((data) => {
14
14
  setLocalStorageData(data);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Utils",
7
- "version": "4.0.1",
7
+ "version": "4.0.2",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -39,5 +39,5 @@
39
39
  "react-swipeable": "7.0.2",
40
40
  "uncontrollable": "8.0.4"
41
41
  },
42
- "gitHead": "84371bbf91915f650a852df849cd71d416c5b7b2"
42
+ "gitHead": "a9f6571146845d828e00206abdedb160980cff97"
43
43
  }
@@ -27,11 +27,11 @@ export const useDataPersist = <TData>({ options, parser, serializer }: DataPersi
27
27
  );
28
28
 
29
29
  const { getData: getLocalStorageData, setData: setLocalStorageData } = useSource<TData>({
30
- source: querySource,
30
+ source: localStorageSource,
31
31
  });
32
32
 
33
33
  const { getData: getQueryParamsData, setData: setQueryParamsData } = useSource<TData>({
34
- source: localStorageSource,
34
+ source: querySource,
35
35
  });
36
36
 
37
37
  const setDataToStorages = useCallback(