@applicaster/zapp-react-native-utils 14.0.0-alpha.3126393935 → 14.0.0-alpha.3471443312

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 (33) hide show
  1. package/actionsExecutor/ActionExecutorContext.tsx +83 -60
  2. package/analyticsUtils/AnalyticsEvents/helper.ts +1 -1
  3. package/appUtils/contextKeysManager/contextResolver.ts +1 -14
  4. package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +0 -15
  5. package/appUtils/playerManager/useChapterMarker.tsx +0 -1
  6. package/appUtils/playerManager/usePlayerControllerSetup.tsx +16 -0
  7. package/navigationUtils/__tests__/mapContentTypesToRivers.test.ts +130 -0
  8. package/navigationUtils/index.ts +6 -4
  9. package/package.json +2 -2
  10. package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +3 -1
  11. package/reactHooks/cell-click/index.ts +1 -8
  12. package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +0 -20
  13. package/reactHooks/feed/useBatchLoading.ts +8 -6
  14. package/reactHooks/feed/useFeedLoader.tsx +14 -17
  15. package/reactHooks/feed/usePipesCacheReset.ts +2 -2
  16. package/reactHooks/layout/__tests__/index.test.tsx +3 -1
  17. package/reactHooks/layout/isTablet/index.ts +5 -2
  18. package/reactHooks/layout/useDimensions/__tests__/useDimensions.test.ts +34 -36
  19. package/reactHooks/layout/useDimensions/useDimensions.ts +2 -3
  20. package/reactHooks/layout/useLayoutVersion.ts +5 -5
  21. package/reactHooks/navigation/useRoute.ts +2 -7
  22. package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +4 -0
  23. package/reactHooks/state/useRivers.ts +7 -8
  24. package/utils/index.ts +1 -0
  25. package/actionsExecutor/ScreenActions.ts +0 -163
  26. package/actionsExecutor/StorageActions.ts +0 -110
  27. package/actionsExecutor/feedDecorator.ts +0 -171
  28. package/actionsExecutor/screenResolver.ts +0 -11
  29. package/reactHooks/navigation/useScreenStateStore.ts +0 -8
  30. package/storage/ScreenSingleValueProvider.ts +0 -201
  31. package/storage/ScreenStateMultiSelectProvider.ts +0 -290
  32. package/storage/StorageMultiSelectProvider.ts +0 -192
  33. package/storage/StorageSingleSelectProvider.ts +0 -108
@@ -16,6 +16,7 @@ import { QUICK_BRICK_EVENTS } from "@applicaster/zapp-react-native-bridge/QuickB
16
16
  import { showConfirmationDialog } from "../alertUtils";
17
17
  import { createCloudEvent, sendCloudEvent } from "../cloudEventsUtils";
18
18
  import { createLogger } from "../logger";
19
+ import { StorageMultiSelectProvider } from "@applicaster/zapp-react-native-bridge/ZappStorage/StorageMultiSelectProvider";
19
20
  import { ACTIVE_LAYOUT_ID_STORAGE_KEY } from "@applicaster/quick-brick-core/App/remoteContextReloader/consts";
20
21
  import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
21
22
  import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
@@ -24,19 +25,15 @@ import {
24
25
  resolveObjectValues,
25
26
  } from "../appUtils/contextKeysManager/contextResolver";
26
27
  import { useNavigation } from "../reactHooks";
28
+ import { get } from "../utils";
27
29
 
28
30
  import {
29
31
  useContentTypes,
30
32
  usePickFromState,
31
33
  } from "@applicaster/zapp-react-native-redux/hooks";
32
- import { useSubscriberFor } from "../reactHooks/useSubscriberFor";
34
+ import { TOGGLE_FLAG_MAX_ITEMS_REACHED_EVENT } from "./consts";
35
+ import { postEvent, useSubscriberFor } from "../reactHooks/useSubscriberFor";
33
36
  import { APP_EVENTS } from "../appUtils/events";
34
- import {
35
- localStorageToggleFlag,
36
- sessionStorageToggleFlag,
37
- } from "./StorageActions";
38
-
39
- import { screenSetVariable, screenToggleFlag } from "./ScreenActions";
40
37
 
41
38
  export const { log_error, log_info, log_debug } = createLogger({
42
39
  subsystem: "ActionExecutorContext",
@@ -85,6 +82,19 @@ function findParentComponent(
85
82
  return null;
86
83
  }
87
84
 
85
+ // send all data just in case (like for message string formatting)
86
+ // Type is not exported for now
87
+ type MaxTagsReachedEvent = {
88
+ selectedItems: string[];
89
+ maxItems: number;
90
+ tag: string;
91
+ keyNamespace: string;
92
+ };
93
+
94
+ async function onMaxTagsReached(data: MaxTagsReachedEvent) {
95
+ postEvent(TOGGLE_FLAG_MAX_ITEMS_REACHED_EVENT, [data]);
96
+ }
97
+
88
98
  const prepareDefaultActions = (actionExecutor) => {
89
99
  actionExecutor.registerAction("localStorageSet", async (action) => {
90
100
  const namespaces = action.options.content;
@@ -168,15 +178,10 @@ const prepareDefaultActions = (actionExecutor) => {
168
178
 
169
179
  const entry = context?.entry || {};
170
180
  const entryResolver = new EntryResolver(entry);
171
- const screenData = context?.screenStateStore.getState().data || {};
172
- const screenResolver = new EntryResolver(screenData || {});
173
181
 
174
182
  const data =
175
183
  options?.data && options.inflateData
176
- ? await resolveObjectValues(options.data, {
177
- entry: entryResolver,
178
- screen: screenResolver,
179
- })
184
+ ? await resolveObjectValues(options.data, { entry: entryResolver })
180
185
  : options?.data || entry;
181
186
 
182
187
  const cloudEvent = await createCloudEvent({
@@ -210,63 +215,81 @@ const prepareDefaultActions = (actionExecutor) => {
210
215
  return ActionResult.Error;
211
216
  });
212
217
 
213
- actionExecutor.registerAction(
214
- "sessionStorageToggleFlag",
215
- async (
216
- action: ActionType,
217
- context?: Record<string, any>
218
- ): Promise<ActionResult> => {
219
- return await sessionStorageToggleFlag(context, action);
220
- }
221
- );
222
-
223
218
  actionExecutor.registerAction(
224
219
  "localStorageToggleFlag",
225
220
  async (
226
221
  action: ActionType,
227
222
  context?: Record<string, any>
228
223
  ): Promise<ActionResult> => {
229
- return await localStorageToggleFlag(context, action);
230
- }
231
- );
224
+ if (!context) {
225
+ log_error(
226
+ "handleAction: localStorageToggleFlag action missing context"
227
+ );
232
228
 
233
- actionExecutor.registerAction(
234
- "screenSetVariable",
235
- async (
236
- action: ActionType,
237
- context?: Record<string, any>
238
- ): Promise<ActionResult> => {
239
- const route = context?.screenRoute;
240
- const screenStateStore = context?.screenStateStore;
241
-
242
- await screenSetVariable(
243
- route,
244
- screenStateStore,
245
- { entry: context?.entry, options: action.options },
246
- action
247
- );
229
+ return ActionResult.Error;
230
+ }
248
231
 
249
- return Promise.resolve(ActionResult.Success);
250
- }
251
- );
232
+ const entry = context?.entry as ZappEntry;
252
233
 
253
- actionExecutor.registerAction(
254
- "screenToggleFlag",
255
- async (
256
- action: ActionType,
257
- context?: Record<string, any>
258
- ): Promise<ActionResult> => {
259
- const screenRoute = context?.screenRoute;
260
- const screenStateStore = context?.screenStateStore;
261
-
262
- await screenToggleFlag(
263
- screenRoute,
264
- screenStateStore,
265
- { entry: context?.entry, options: action.options },
266
- action
267
- );
234
+ if (!entry) {
235
+ log_error(
236
+ "handleAction: localStorageToggleFlag action missing entry. Entry is required to get the tag."
237
+ );
238
+
239
+ return ActionResult.Error;
240
+ }
241
+
242
+ const tag = action.options?.selector
243
+ ? get(entry, action.options.selector)
244
+ : (entry.extensions?.tag ?? entry.id);
245
+
246
+ const keyNamespace = action.options?.key;
247
+
248
+ if (keyNamespace && tag) {
249
+ const multiSelectProvider =
250
+ StorageMultiSelectProvider.getProvider(keyNamespace);
251
+
252
+ const selectedItems = await multiSelectProvider.getSelectedAsync();
253
+ const isTagInSelectedItems = selectedItems.includes(tag);
268
254
 
269
- return Promise.resolve(ActionResult.Success);
255
+ log_info(
256
+ `handleAction: localStorageToggleFlag event will ${
257
+ isTagInSelectedItems ? "remove" : "add"
258
+ } tag: ${tag} for keyNamespace: ${keyNamespace}, current selectedItems: ${selectedItems}`
259
+ );
260
+
261
+ if (selectedItems.includes(tag)) {
262
+ await multiSelectProvider.removeItem(tag);
263
+ } else {
264
+ const maxItems = action.options?.max_items;
265
+
266
+ if (maxItems && selectedItems.length >= maxItems) {
267
+ log_info(
268
+ `handleAction: localStorageToggleFlag event reached max items limit: ${maxItems}, cannot add tag: ${tag}`
269
+ );
270
+
271
+ await onMaxTagsReached({
272
+ selectedItems,
273
+ maxItems,
274
+ tag,
275
+ keyNamespace,
276
+ });
277
+
278
+ return ActionResult.Cancel;
279
+ }
280
+
281
+ await multiSelectProvider.addItem(tag);
282
+ }
283
+ } else {
284
+ log_error(
285
+ "handleAction: localStorageToggleFlag event missing keyNamespace or tag",
286
+ { keyNamespace, tag }
287
+ );
288
+
289
+ return ActionResult.Error;
290
+ }
291
+
292
+ return ActionResult.Success;
270
293
  }
271
294
  );
272
295
  };
@@ -9,7 +9,7 @@ import {
9
9
  } from "../events";
10
10
  import { isEmptyOrNil } from "../../cellUtils";
11
11
  import { get } from "lodash";
12
- import { StorageMultiSelectProvider } from "@applicaster/zapp-react-native-utils/storage/StorageMultiSelectProvider";
12
+ import { StorageMultiSelectProvider } from "@applicaster/zapp-react-native-bridge/ZappStorage/StorageMultiSelectProvider";
13
13
 
14
14
  export enum OfflineItemState {
15
15
  notExist = "NOT_EXISTS",
@@ -1,11 +1,10 @@
1
1
  import { ContextKeysManager } from "./index";
2
2
  import * as R from "ramda";
3
3
 
4
- export interface IResolver {
4
+ interface IResolver {
5
5
  resolve: (string) => Promise<string | number | object>;
6
6
  }
7
7
 
8
- // TODO: Rename to ObjectKeyResolver or similar
9
8
  export class EntryResolver implements IResolver {
10
9
  entry: ZappEntry;
11
10
 
@@ -22,18 +21,6 @@ export class EntryResolver implements IResolver {
22
21
  }
23
22
  }
24
23
 
25
- // TODO: Move to proper place
26
-
27
- export class ScreenStateResolver implements IResolver {
28
- constructor(private screenStateStore: ScreenStateStore) {}
29
-
30
- async resolve(key: string) {
31
- const screenState = this.screenStateStore.getState().data;
32
-
33
- return screenState?.[key];
34
- }
35
- }
36
-
37
24
  export class ContextResolver implements IResolver {
38
25
  resolve = async (compositeKey: string) =>
39
26
  ContextKeysManager.instance.getKey(compositeKey);
@@ -18,13 +18,6 @@ export const { log_verbose, log_debug, log_info, log_error } = createLogger({
18
18
  parent: utilsLogger,
19
19
  });
20
20
 
21
- type ActionChapter = {
22
- type: string;
23
- options?: {
24
- title: string;
25
- };
26
- };
27
-
28
21
  type ChapterMarkerOriginal = {
29
22
  id: string;
30
23
  title: string;
@@ -33,14 +26,6 @@ type ChapterMarkerOriginal = {
33
26
  actions: ActionChapter[];
34
27
  };
35
28
 
36
- export type ChapterMarkerEvent = {
37
- id: string;
38
- title: string;
39
- start_time: number;
40
- end_time: number;
41
- actions: ActionChapter[];
42
- };
43
-
44
29
  export type TitleSummaryEvent = {
45
30
  title: string | number;
46
31
  summary: string | number;
@@ -1,4 +1,3 @@
1
- import { ChapterMarkerEvent } from "./OverlayObserver/OverlaysObserver";
2
1
  import { usePlayer } from "./usePlayer";
3
2
  import * as React from "react";
4
3
 
@@ -5,6 +5,9 @@ import { playerManager } from "./index";
5
5
  import { useValidatePlayerConfig } from "../../playerUtils/useValidatePlayerConfig";
6
6
  import { PlayerRole } from "./conts";
7
7
  import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
8
+ import { TVSeekController } from "../../reactHooks/player/TVSeekControlller/TVSeekController";
9
+ import { KeyInputHandler } from "../keyInputHandler/KeyInputHandler";
10
+ import { isTV } from "../../reactUtils";
8
11
 
9
12
  // TODO: Rename to ControllerType
10
13
  export const usePlayerControllerSetup = ({
@@ -76,5 +79,18 @@ export const usePlayerControllerSetup = ({
76
79
  };
77
80
  }, [playerId, playerController]);
78
81
 
82
+ useEffect(() => {
83
+ if (!isTV()) {
84
+ return;
85
+ }
86
+
87
+ if (playerController) {
88
+ const seekController = new TVSeekController(playerController);
89
+ playerController.seekController = seekController;
90
+
91
+ return KeyInputHandler.getInstance().addListener(seekController);
92
+ }
93
+ }, [playerController]);
94
+
79
95
  return playerController;
80
96
  };
@@ -0,0 +1,130 @@
1
+ import { mapContentTypesToRivers } from "../index";
2
+
3
+ describe("mapContentTypesToRivers", () => {
4
+ it("should return the correct content types mapped to rivers", () => {
5
+ const state = {
6
+ rivers: {
7
+ "river-1": {
8
+ plugin_type: "river",
9
+ },
10
+ },
11
+ contentTypes: {
12
+ "content-type-1": {
13
+ screen_id: "river-1",
14
+ },
15
+ },
16
+ };
17
+
18
+ const result = mapContentTypesToRivers(state);
19
+
20
+ expect(result).toEqual({
21
+ "content-type-1": {
22
+ screenType: "river",
23
+ screen_id: "river-1",
24
+ },
25
+ });
26
+ });
27
+
28
+ it("should return null if contentTypes is undefined", () => {
29
+ const state = {
30
+ rivers: {
31
+ "river-1": {
32
+ plugin_type: "river",
33
+ },
34
+ },
35
+ // contentTypes is missing
36
+ };
37
+
38
+ const result = mapContentTypesToRivers(state);
39
+
40
+ expect(result).toBeNull();
41
+ });
42
+
43
+ it("should skip content types whose screen does not exist in rivers", () => {
44
+ const state = {
45
+ rivers: {
46
+ "river-1": {
47
+ plugin_type: "river",
48
+ },
49
+ },
50
+ contentTypes: {
51
+ "content-type-1": {
52
+ screen_id: "river-1",
53
+ },
54
+ "content-type-2": {
55
+ screen_id: "river-2", // river-2 does not exist
56
+ },
57
+ },
58
+ };
59
+
60
+ const result = mapContentTypesToRivers(state);
61
+
62
+ expect(result).toEqual({
63
+ "content-type-1": {
64
+ screenType: "river",
65
+ screen_id: "river-1",
66
+ },
67
+ });
68
+
69
+ // result is not null, but may be undefined for missing keys
70
+ expect(result && result["content-type-2"]).toBeUndefined();
71
+ });
72
+
73
+ it("should use 'type' if 'plugin_type' is not present in river", () => {
74
+ const state = {
75
+ rivers: {
76
+ "river-1": {
77
+ type: "custom-type",
78
+ },
79
+ },
80
+ contentTypes: {
81
+ "content-type-1": {
82
+ screen_id: "river-1",
83
+ },
84
+ },
85
+ };
86
+
87
+ const result = mapContentTypesToRivers(state);
88
+
89
+ expect(result).toEqual({
90
+ "content-type-1": {
91
+ screenType: "custom-type",
92
+ screen_id: "river-1",
93
+ },
94
+ });
95
+ });
96
+
97
+ it("should skip content types if neither plugin_type nor type is present in river", () => {
98
+ const state = {
99
+ rivers: {
100
+ "river-1": {
101
+ // no plugin_type or type
102
+ },
103
+ },
104
+ contentTypes: {
105
+ "content-type-1": {
106
+ screen_id: "river-1",
107
+ },
108
+ },
109
+ };
110
+
111
+ const result = mapContentTypesToRivers(state);
112
+
113
+ expect(result).toEqual({});
114
+ });
115
+
116
+ it("should handle empty contentTypes object", () => {
117
+ const state = {
118
+ rivers: {
119
+ "river-1": {
120
+ plugin_type: "river",
121
+ },
122
+ },
123
+ contentTypes: {},
124
+ };
125
+
126
+ const result = mapContentTypesToRivers(state);
127
+
128
+ expect(result).toEqual({});
129
+ });
130
+ });
@@ -13,6 +13,7 @@ import {
13
13
  isPlayable,
14
14
  isV2River,
15
15
  } from "./itemTypeMatchers";
16
+ import { RootState } from "@applicaster/zapp-react-native-redux/store";
16
17
 
17
18
  type PathAttribute = {
18
19
  screenType: string;
@@ -377,10 +378,11 @@ export const usesVideoModal = (
377
378
  return targetScreenConfiguration?.styles?.use_video_modal;
378
379
  };
379
380
 
380
- export const mapContentTypesToRivers = ({
381
- rivers,
382
- contentTypes,
383
- }): ZappContentTypesMapped | null => {
381
+ export const mapContentTypesToRivers = (
382
+ state: Partial<RootState>
383
+ ): ZappContentTypesMapped | null => {
384
+ const { rivers, contentTypes } = state;
385
+
384
386
  if (!contentTypes) {
385
387
  return null;
386
388
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "14.0.0-alpha.3126393935",
3
+ "version": "14.0.0-alpha.3471443312",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "14.0.0-alpha.3126393935",
30
+ "@applicaster/applicaster-types": "14.0.0-alpha.3471443312",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -21,7 +21,9 @@ jest.mock(
21
21
 
22
22
  jest.useFakeTimers({ legacyFakeTimers: true });
23
23
 
24
- jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation");
24
+ jest.mock(
25
+ "@applicaster/zapp-react-native-utils/reactHooks/navigation/useNavigation"
26
+ );
25
27
 
26
28
  const mockStore = configureStore();
27
29
 
@@ -16,8 +16,7 @@ import { ActionExecutorContext } from "@applicaster/zapp-react-native-utils/acti
16
16
  import { isFunction, noop } from "../../functionUtils";
17
17
  import { useSendAnalyticsOnPress } from "../analytics";
18
18
  import { logOnPress, warnEmptyContentType } from "./helpers";
19
- import { useCurrentScreenData, useScreenContext } from "../screen";
20
- import { useScreenStateStore } from "../navigation/useScreenStateStore";
19
+ import { useCurrentScreenData } from "../screen";
21
20
 
22
21
  /**
23
22
  * If onCellTap is defined execute the function and
@@ -43,12 +42,10 @@ export const useCellClick = ({
43
42
  }: Props): onPressReturnFn => {
44
43
  const { push, currentRoute } = useNavigation();
45
44
  const { pathname } = useRoute();
46
- const screenStateStore = useScreenStateStore();
47
45
 
48
46
  const onCellTap: Option<Function> = React.useContext(CellTapContext);
49
47
  const actionExecutor = React.useContext(ActionExecutorContext);
50
48
  const screenData = useCurrentScreenData();
51
- const screenState = useScreenContext()?.options;
52
49
 
53
50
  const cellSelectable = toBooleanWithDefaultTrue(
54
51
  component?.rules?.component_cells_selectable
@@ -86,9 +83,6 @@ export const useCellClick = ({
86
83
  await actionExecutor?.handleEntryActions(selectedItem, {
87
84
  component,
88
85
  screenData,
89
- screenState,
90
- screenRoute: pathname,
91
- screenStateStore,
92
86
  });
93
87
  }
94
88
 
@@ -123,7 +117,6 @@ export const useCellClick = ({
123
117
  push,
124
118
  sendAnalyticsOnPress,
125
119
  screenData,
126
- screenState,
127
120
  ]
128
121
  );
129
122
 
@@ -138,11 +138,6 @@ describe("useFeedLoader", () => {
138
138
  expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {
139
139
  clearCache: true,
140
140
  riverId: undefined,
141
- resolvers: {
142
- screen: {
143
- screenStateStore: undefined,
144
- },
145
- },
146
141
  });
147
142
 
148
143
  const store2 = mockStore({
@@ -184,11 +179,6 @@ describe("useFeedLoader", () => {
184
179
  expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {
185
180
  clearCache: true,
186
181
  riverId: undefined,
187
- resolvers: {
188
- screen: {
189
- screenStateStore: undefined,
190
- },
191
- },
192
182
  });
193
183
 
194
184
  const store2 = mockStore({
@@ -238,11 +228,6 @@ describe("useFeedLoader", () => {
238
228
  expect(loadPipesDataSpy).toBeCalledWith(feedUrl, {
239
229
  clearCache: true,
240
230
  silentRefresh: true,
241
- resolvers: {
242
- screen: {
243
- screenStateStore: undefined,
244
- },
245
- },
246
231
  });
247
232
 
248
233
  loadPipesDataSpy.mockRestore();
@@ -282,11 +267,6 @@ describe("useFeedLoader", () => {
282
267
  expect(loadPipesDataSpy).toBeCalledWith(nextUrl, {
283
268
  parentFeed: feedUrlWithNext,
284
269
  silentRefresh: true,
285
- resolvers: {
286
- screen: {
287
- screenStateStore: undefined,
288
- },
289
- },
290
270
  });
291
271
 
292
272
  loadPipesDataSpy.mockRestore();
@@ -1,8 +1,10 @@
1
1
  import { complement, compose, isNil, map, min, prop, take, uniq } from "ramda";
2
- import { useDispatch } from "react-redux";
3
2
  import * as React from "react";
4
- import { useZappPipesFeeds } from "@applicaster/zapp-react-native-redux/hooks";
5
- import { loadPipesData } from "@applicaster/zapp-react-native-redux/ZappPipes";
3
+ import {
4
+ ZappPipes,
5
+ useAppDispatch,
6
+ useZappPipesFeed,
7
+ } from "@applicaster/zapp-react-native-redux";
6
8
  import { isNilOrEmpty } from "../../reactUtils/helpers";
7
9
  import { ZappPipesSearchContext } from "@applicaster/zapp-react-native-ui-components/Contexts";
8
10
  import {
@@ -63,7 +65,7 @@ export const useBatchLoading = (
63
65
  componentsToRender: { data?: ZappDataSource; component_type: string }[],
64
66
  options: Options
65
67
  ) => {
66
- const dispatch = useDispatch();
68
+ const dispatch = useAppDispatch();
67
69
  const { screen: screenContext, entry: entryContext } = useScreenContext();
68
70
  const [searchContext] = ZappPipesSearchContext.useZappPipesContext();
69
71
  const [hasEverBeenReady, setHasEverBeenReady] = React.useState(false);
@@ -118,7 +120,7 @@ export const useBatchLoading = (
118
120
  []
119
121
  );
120
122
 
121
- const feeds = useZappPipesFeeds(feedUrls);
123
+ const feeds = useZappPipesFeed(feedUrls);
122
124
 
123
125
  // dispatch loadPipesData for each feed that is not loaded
124
126
  const runBatchLoading = React.useCallback(() => {
@@ -139,7 +141,7 @@ export const useBatchLoading = (
139
141
  if (mappedFeedUrl) {
140
142
  // 4. load data
141
143
  return dispatch(
142
- loadPipesData(mappedFeedUrl, { riverId: options.riverId })
144
+ ZappPipes.loadPipesData(mappedFeedUrl, { riverId: options.riverId })
143
145
  );
144
146
  }
145
147
  }