@applicaster/zapp-react-native-utils 13.0.0-alpha.5855333506 → 13.0.0-alpha.6518750342
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.
|
@@ -33,7 +33,7 @@ class ActionExecutor {
|
|
|
33
33
|
|
|
34
34
|
log_debug(
|
|
35
35
|
`handleAction: ${action.type}${
|
|
36
|
-
entry ? `, entry id ${entry
|
|
36
|
+
entry ? `, entry id ${entry.id}, title: ${entry.title}` : ""
|
|
37
37
|
}`,
|
|
38
38
|
{ action, entry }
|
|
39
39
|
);
|
|
@@ -100,7 +100,10 @@ class ActionExecutor {
|
|
|
100
100
|
|
|
101
101
|
registerAction = (
|
|
102
102
|
type: string,
|
|
103
|
-
handler: (
|
|
103
|
+
handler: (
|
|
104
|
+
action: ActionType,
|
|
105
|
+
context?: Record<string, any>
|
|
106
|
+
) => Promise<ActionResult>
|
|
104
107
|
) => {
|
|
105
108
|
if (this.registeredActions[type]) {
|
|
106
109
|
log_error(`registerAction: action type: ${type} already registered`);
|
|
@@ -25,7 +25,6 @@ const { log_error, log_info } = createLogger({
|
|
|
25
25
|
category: "General",
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
// TODO: move entry inside options and rename options to context
|
|
29
28
|
type ActionExecutorContextType = {
|
|
30
29
|
registerAction: (
|
|
31
30
|
type: string,
|
|
@@ -166,9 +165,12 @@ const prepareDefaultActions = (actionExecutor) => {
|
|
|
166
165
|
|
|
167
166
|
actionExecutor.registerAction(
|
|
168
167
|
"localStorageToggleFlag",
|
|
169
|
-
async (
|
|
168
|
+
async (
|
|
169
|
+
action: ActionType,
|
|
170
|
+
context?: Record<string, any>
|
|
171
|
+
): Promise<ActionResult> => {
|
|
170
172
|
const keyNamespace = action.options?.key;
|
|
171
|
-
const tag = entry?.extensions?.tag;
|
|
173
|
+
const tag = context?.entry?.extensions?.tag;
|
|
172
174
|
|
|
173
175
|
if (keyNamespace && tag) {
|
|
174
176
|
const multiSelectProvider =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "13.0.0-alpha.
|
|
3
|
+
"version": "13.0.0-alpha.6518750342",
|
|
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-alpha.
|
|
31
|
+
"@applicaster/applicaster-types": "13.0.0-alpha.6518750342",
|
|
32
32
|
"buffer": "^5.2.1",
|
|
33
33
|
"camelize": "^1.0.0",
|
|
34
34
|
"create-react-context": "^0.2.3",
|
|
@@ -20,6 +20,7 @@ type Props = {
|
|
|
20
20
|
silentRefresh?: boolean;
|
|
21
21
|
method?: "get" | "post";
|
|
22
22
|
bodyParams?: Record<string, unknown>;
|
|
23
|
+
skipLoading?: boolean;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -93,7 +94,7 @@ export const useFeedLoader = ({
|
|
|
93
94
|
if (
|
|
94
95
|
shouldDispatchData(callableFeedUrl, currentFeed, pipesOptions.clearCache)
|
|
95
96
|
) {
|
|
96
|
-
if (callableFeedUrl) {
|
|
97
|
+
if (callableFeedUrl && !pipesOptions.skipLoading) {
|
|
97
98
|
dispatch(
|
|
98
99
|
loadPipesData(callableFeedUrl, {
|
|
99
100
|
...pipesOptions,
|
|
@@ -101,26 +102,33 @@ export const useFeedLoader = ({
|
|
|
101
102
|
riverId,
|
|
102
103
|
})
|
|
103
104
|
);
|
|
104
|
-
} else {
|
|
105
|
+
} else if (!callableFeedUrl) {
|
|
105
106
|
logger.info({
|
|
106
107
|
message:
|
|
107
108
|
"Feed is not defined or not inflated, skipping loading. \nMake sure you have correct feedUrl and mapping.",
|
|
108
109
|
jsOnly: true,
|
|
109
110
|
});
|
|
111
|
+
} else {
|
|
112
|
+
logger.info({
|
|
113
|
+
message:
|
|
114
|
+
"Loading skipped as per pipesOptions.skipLoading configuration.",
|
|
115
|
+
data: { url: callableFeedUrl },
|
|
116
|
+
jsOnly: true,
|
|
117
|
+
});
|
|
110
118
|
}
|
|
111
119
|
} else {
|
|
112
120
|
logger.info({
|
|
113
121
|
message:
|
|
114
|
-
"Feed already
|
|
122
|
+
"Feed already exists, skipping loading. \nCall reloadData() if you want to refresh data.",
|
|
115
123
|
data: { url: callableFeedUrl },
|
|
116
124
|
jsOnly: true,
|
|
117
125
|
});
|
|
118
126
|
}
|
|
119
127
|
}, []);
|
|
120
128
|
|
|
121
|
-
// Reload feed when feedUrl changes
|
|
129
|
+
// Reload feed when feedUrl changes, unless skipLoading is true
|
|
122
130
|
useEffect(() => {
|
|
123
|
-
if (!isInitialRender && callableFeedUrl) {
|
|
131
|
+
if (!isInitialRender && callableFeedUrl && !pipesOptions.skipLoading) {
|
|
124
132
|
dispatch(loadPipesData(callableFeedUrl, { ...pipesOptions, riverId }));
|
|
125
133
|
}
|
|
126
134
|
}, [callableFeedUrl]);
|
|
@@ -156,7 +164,6 @@ export const useFeedLoader = ({
|
|
|
156
164
|
currentFeed?.data,
|
|
157
165
|
currentFeed?.error,
|
|
158
166
|
currentFeed?.loading,
|
|
159
|
-
|
|
160
167
|
reloadData,
|
|
161
168
|
loadNext,
|
|
162
169
|
]);
|