srasm 0.0.5 → 0.0.6

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/index.cjs CHANGED
@@ -100,7 +100,11 @@ function createStateStore(initialSlices) {
100
100
  if (useDeepEqualCheck && deepEqual(current, next)) return;
101
101
  } else {
102
102
  if (typeof current === "object" && current !== null && typeof payload === "object" && payload !== null) {
103
- next = { ...current, ...payload };
103
+ if (Array.isArray(current) || Array.isArray(payload)) {
104
+ next = payload;
105
+ } else {
106
+ next = { ...current, ...payload };
107
+ }
104
108
  if (useDeepEqualCheck && deepEqual(current, next)) return;
105
109
  } else {
106
110
  if (Object.is(current, payload)) return;
@@ -145,7 +149,7 @@ function createStateStore(initialSlices) {
145
149
  }, [slice, fetcher, setState]);
146
150
  import_react.default.useEffect(() => {
147
151
  fetchData();
148
- }, [JSON.stringify(tags)]);
152
+ }, [fetchData, JSON.stringify(tags)]);
149
153
  return {
150
154
  data: state,
151
155
  loading,
package/dist/index.js CHANGED
@@ -64,7 +64,11 @@ function createStateStore(initialSlices) {
64
64
  if (useDeepEqualCheck && deepEqual(current, next)) return;
65
65
  } else {
66
66
  if (typeof current === "object" && current !== null && typeof payload === "object" && payload !== null) {
67
- next = { ...current, ...payload };
67
+ if (Array.isArray(current) || Array.isArray(payload)) {
68
+ next = payload;
69
+ } else {
70
+ next = { ...current, ...payload };
71
+ }
68
72
  if (useDeepEqualCheck && deepEqual(current, next)) return;
69
73
  } else {
70
74
  if (Object.is(current, payload)) return;
@@ -109,7 +113,7 @@ function createStateStore(initialSlices) {
109
113
  }, [slice, fetcher, setState]);
110
114
  React.useEffect(() => {
111
115
  fetchData();
112
- }, [JSON.stringify(tags)]);
116
+ }, [fetchData, JSON.stringify(tags)]);
113
117
  return {
114
118
  data: state,
115
119
  loading,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srasm",
3
3
  "private": false,
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",