@applicaster/zapp-react-native-utils 15.0.0-rc.98 → 15.0.0-rc.99

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.
@@ -0,0 +1,13 @@
1
+ function platformIsTV(platform) {
2
+ return [
3
+ "tvos_for_quickbrick",
4
+ "android_tv_for_quickbrick",
5
+ "amazon_fire_tv_for_quickbrick",
6
+ "lg_tv",
7
+ "samsung_tv",
8
+ "web",
9
+ "vizio",
10
+ ].includes(platform);
11
+ }
12
+
13
+ module.exports = { platformIsTV };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "15.0.0-rc.98",
3
+ "version": "15.0.0-rc.99",
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": "15.0.0-rc.98",
30
+ "@applicaster/applicaster-types": "15.0.0-rc.99",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { scrollEndReached$ } from "@applicaster/zapp-react-native-ui-components/events";
3
+ import { filter } from "rxjs/operators";
4
+
5
+ /**
6
+ * Subscribe to scroll-end-reached and call loadNextData only when this item is last in the river.
7
+ * Use in Grid/List so they load next page when the user scrolls to the end (river or tabs scroll container).
8
+ */
9
+ export function useScrollEndReachedLoadNext(
10
+ isLast: boolean,
11
+ loadNextData: () => void
12
+ ): void {
13
+ React.useEffect(() => {
14
+ const sub = scrollEndReached$.pipe(filter(() => isLast)).subscribe(() => {
15
+ loadNextData();
16
+ });
17
+
18
+ return () => sub.unsubscribe();
19
+ }, [isLast, loadNextData]);
20
+ }
@@ -15,3 +15,5 @@ export * from "./device";
15
15
  export * from "./screen";
16
16
 
17
17
  export * from "./state";
18
+
19
+ export * from "./events";