@applicaster/zapp-react-native-utils 13.0.0-rc.4 → 13.0.0-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "13.0.0-rc.4",
3
+ "version": "13.0.0-rc.6",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "13.0.0-rc.4",
31
+ "@applicaster/applicaster-types": "13.0.0-rc.6",
32
32
  "buffer": "^5.2.1",
33
33
  "camelize": "^1.0.0",
34
34
  "create-react-context": "^0.2.3",
@@ -135,7 +135,11 @@ describe("useFeedLoader", () => {
135
135
  );
136
136
 
137
137
  expect(result.current.data).toBeNull();
138
- expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {});
138
+
139
+ expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {
140
+ clearCache: true,
141
+ riverId: undefined,
142
+ });
139
143
 
140
144
  const store2 = mockStore({
141
145
  plugins: [],
@@ -172,7 +176,11 @@ describe("useFeedLoader", () => {
172
176
  );
173
177
 
174
178
  expect(result.current.data).toBeNull();
175
- expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {});
179
+
180
+ expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {
181
+ clearCache: true,
182
+ riverId: undefined,
183
+ });
176
184
 
177
185
  const store2 = mockStore({
178
186
  plugins: [],
@@ -5,7 +5,7 @@ import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
5
5
  import { useZappPipesFeed } from "@applicaster/zapp-react-native-redux/hooks";
6
6
 
7
7
  import { reactHooksLogger } from "../logger";
8
- import { useIsInitialRender, shouldUseCachedData } from "../utils";
8
+ import { useIsInitialRender, shouldDispatchData } from "../utils";
9
9
  import { useInflatedUrl } from "./useInflatedUrl";
10
10
  import { useRoute } from "../navigation";
11
11
 
@@ -89,13 +89,18 @@ export const useFeedLoader = ({
89
89
  }
90
90
  }, [callableFeedUrl, currentFeed?.data]);
91
91
 
92
- // If feed doesn't exist, load it
93
92
  useEffect(() => {
94
93
  if (
95
- shouldUseCachedData(callableFeedUrl, currentFeed, pipesOptions.clearCache)
94
+ shouldDispatchData(callableFeedUrl, currentFeed, pipesOptions.clearCache)
96
95
  ) {
97
96
  if (callableFeedUrl) {
98
- dispatch(loadPipesData(callableFeedUrl, { ...pipesOptions, riverId }));
97
+ dispatch(
98
+ loadPipesData(callableFeedUrl, {
99
+ ...pipesOptions,
100
+ clearCache: true,
101
+ riverId,
102
+ })
103
+ );
99
104
  } else {
100
105
  logger.info({
101
106
  message:
@@ -33,7 +33,7 @@ export const useIsInitialRender = (): boolean => {
33
33
 
34
34
  export const checkIsLocalFeed = (feedUrl) => feedUrl?.startsWith("pipesv2://");
35
35
 
36
- export const shouldUseCachedData = (
36
+ export const shouldDispatchData = (
37
37
  url: string,
38
38
  feed: ZappPipesData | null,
39
39
  clearCache: boolean