@applicaster/zapp-react-native-utils 14.0.0-alpha.5974411329 → 14.0.0-alpha.6240202185
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/actionsExecutor/ActionExecutorContext.tsx +83 -60
- package/analyticsUtils/AnalyticsEvents/helper.ts +1 -1
- package/appUtils/contextKeysManager/contextResolver.ts +1 -31
- package/package.json +2 -2
- package/reactHooks/cell-click/index.ts +1 -8
- package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +0 -20
- package/reactHooks/feed/useFeedLoader.tsx +5 -14
- package/reactHooks/navigation/useRoute.ts +2 -7
- package/actionsExecutor/ScreenActions.ts +0 -163
- package/actionsExecutor/StorageActions.ts +0 -110
- package/actionsExecutor/feedDecorator.ts +0 -171
- package/actionsExecutor/screenResolver.ts +0 -11
- package/reactHooks/navigation/useScreenStateStore.ts +0 -8
- package/storage/ScreenSingleValueProvider.ts +0 -201
- package/storage/ScreenStateMultiSelectProvider.ts +0 -290
- package/storage/StorageMultiSelectProvider.ts +0 -192
- package/storage/StorageSingleSelectProvider.ts +0 -108
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { ActionResult } from "./ActionExecutor";
|
|
2
|
-
import { get } from "lodash";
|
|
3
|
-
import { StorageMultiSelectProvider } from "@applicaster/zapp-react-native-utils/storage/StorageMultiSelectProvider";
|
|
4
|
-
import { log_error, log_info } from "./ActionExecutorContext";
|
|
5
|
-
import { postEvent } from "../reactHooks/useSubscriberFor";
|
|
6
|
-
import { TOGGLE_FLAG_MAX_ITEMS_REACHED_EVENT } from "./consts";
|
|
7
|
-
import { StorageType } from "../appUtils/contextKeysManager/consts";
|
|
8
|
-
|
|
9
|
-
// send all data just in case (like for message string formatting)
|
|
10
|
-
// Type is not exported for now
|
|
11
|
-
type MaxTagsReachedEvent = {
|
|
12
|
-
selectedItems: string[];
|
|
13
|
-
maxItems: number;
|
|
14
|
-
tag: string;
|
|
15
|
-
keyNamespace: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export async function onMaxTagsReached(data: MaxTagsReachedEvent) {
|
|
19
|
-
postEvent(TOGGLE_FLAG_MAX_ITEMS_REACHED_EVENT, [data]);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function storageToggleFlag(
|
|
23
|
-
context: Record<string, any>,
|
|
24
|
-
action: ActionType,
|
|
25
|
-
storageType: StorageType
|
|
26
|
-
) {
|
|
27
|
-
if (!context) {
|
|
28
|
-
log_error("handleAction: localStorageToggleFlag action missing context");
|
|
29
|
-
|
|
30
|
-
return ActionResult.Error;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const entry = context?.entry as ZappEntry;
|
|
34
|
-
|
|
35
|
-
if (!entry) {
|
|
36
|
-
log_error(
|
|
37
|
-
"handleAction: localStorageToggleFlag action missing entry. Entry is required to get the tag."
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
return ActionResult.Error;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const tag = action.options?.selector
|
|
44
|
-
? get(entry, action.options.selector)
|
|
45
|
-
: (entry.extensions?.tag ?? entry.id);
|
|
46
|
-
|
|
47
|
-
const keyNamespace = action.options?.key;
|
|
48
|
-
|
|
49
|
-
if (keyNamespace && tag) {
|
|
50
|
-
const multiSelectProvider = StorageMultiSelectProvider.getProvider(
|
|
51
|
-
keyNamespace,
|
|
52
|
-
storageType
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const selectedItems = await multiSelectProvider.getSelectedAsync();
|
|
56
|
-
const isTagInSelectedItems = selectedItems.includes(tag);
|
|
57
|
-
|
|
58
|
-
log_info(
|
|
59
|
-
`handleAction: localStorageToggleFlag event will ${
|
|
60
|
-
isTagInSelectedItems ? "remove" : "add"
|
|
61
|
-
} tag: ${tag} for keyNamespace: ${keyNamespace}, current selectedItems: ${selectedItems}`
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
if (selectedItems.includes(tag)) {
|
|
65
|
-
await multiSelectProvider.removeItem(tag);
|
|
66
|
-
} else {
|
|
67
|
-
const maxItems = action.options?.max_items;
|
|
68
|
-
|
|
69
|
-
if (maxItems && selectedItems.length >= maxItems) {
|
|
70
|
-
log_info(
|
|
71
|
-
`handleAction: localStorageToggleFlag event reached max items limit: ${maxItems}, cannot add tag: ${tag}`
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
await onMaxTagsReached({
|
|
75
|
-
selectedItems,
|
|
76
|
-
maxItems,
|
|
77
|
-
tag,
|
|
78
|
-
keyNamespace,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
return ActionResult.Cancel;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
await multiSelectProvider.addItem(tag);
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
log_error(
|
|
88
|
-
"handleAction: localStorageToggleFlag event missing keyNamespace or tag",
|
|
89
|
-
{ keyNamespace, tag }
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
return ActionResult.Error;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return ActionResult.Success;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export async function sessionStorageToggleFlag(
|
|
99
|
-
context: Record<string, any>,
|
|
100
|
-
action: ActionType
|
|
101
|
-
) {
|
|
102
|
-
return storageToggleFlag(context, action, StorageType.session);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export async function localStorageToggleFlag(
|
|
106
|
-
context: Record<string, any>,
|
|
107
|
-
action: ActionType
|
|
108
|
-
) {
|
|
109
|
-
return storageToggleFlag(context, action, StorageType.local);
|
|
110
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import * as R from "ramda";
|
|
2
|
-
import { getNamespaceAndKey } from "../appUtils/contextKeysManager/utils";
|
|
3
|
-
import { createLogger } from "../logger";
|
|
4
|
-
|
|
5
|
-
const { log_error, log_verbose } = createLogger({
|
|
6
|
-
subsystem: "FeedDecorator",
|
|
7
|
-
category: "General",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
function getScope(scope) {
|
|
11
|
-
if (scope === "screen") {
|
|
12
|
-
return scope;
|
|
13
|
-
} else if (!scope || scope === "ctx") {
|
|
14
|
-
return "ctx";
|
|
15
|
-
} else {
|
|
16
|
-
log_verbose(
|
|
17
|
-
`decorateFeed: Unsupported scope "${scope}" provided in preference_editor_options. Defaulting to "ctx".`
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
return "ctx";
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function makeMultiSelect(feed: ZappFeed, key, decoratedFeed) {
|
|
25
|
-
const scope = getScope(
|
|
26
|
-
decoratedFeed.extensions?.preference_editor_options?.scope
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const behavior = {
|
|
30
|
-
...feed.extensions?.["behavior"],
|
|
31
|
-
select_mode: "multi",
|
|
32
|
-
current_selection: `@{${scope}/${key}}`,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
if (!feed.extensions) {
|
|
36
|
-
decoratedFeed.extensions = {
|
|
37
|
-
behavior,
|
|
38
|
-
};
|
|
39
|
-
} else {
|
|
40
|
-
decoratedFeed.extensions.behavior = behavior;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const actionType =
|
|
44
|
-
decoratedFeed.extensions?.preference_editor_options?.scope === "screen"
|
|
45
|
-
? "screenToggleFlag"
|
|
46
|
-
: decoratedFeed.extensions?.preference_editor_options?.scope === "session"
|
|
47
|
-
? "sessionStorageToggleFlag"
|
|
48
|
-
: "localStorageToggleFlag";
|
|
49
|
-
|
|
50
|
-
decoratedFeed.entry?.forEach((entry: ZappEntry) => {
|
|
51
|
-
entry.type.value = "action";
|
|
52
|
-
entry.id = entry.extensions?.tag || entry.id;
|
|
53
|
-
|
|
54
|
-
entry.extensions = {
|
|
55
|
-
...(entry.extensions || {}),
|
|
56
|
-
tap_actions: {
|
|
57
|
-
actions: [
|
|
58
|
-
{
|
|
59
|
-
type: actionType,
|
|
60
|
-
options: {
|
|
61
|
-
key,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
return decoratedFeed;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function makeSingleSelect(feed: ZappFeed, key, decoratedFeed) {
|
|
73
|
-
const scope = getScope(
|
|
74
|
-
decoratedFeed.extensions?.preference_editor_options?.scope
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
const behavior = {
|
|
78
|
-
...feed.extensions?.["behavior"],
|
|
79
|
-
select_mode: "single",
|
|
80
|
-
current_selection: `@{${scope}/${key}}`,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
if (!feed.extensions) {
|
|
84
|
-
decoratedFeed.extensions = {
|
|
85
|
-
behavior,
|
|
86
|
-
};
|
|
87
|
-
} else {
|
|
88
|
-
decoratedFeed.extensions.behavior = behavior;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const localStorageProducer = (entry: ZappFeed) => {
|
|
92
|
-
entry.id = entry.extensions?.tag || entry.id;
|
|
93
|
-
const { key: keyName, namespace } = getNamespaceAndKey(key);
|
|
94
|
-
|
|
95
|
-
const action =
|
|
96
|
-
decoratedFeed.extensions?.preference_editor_options?.scope === "session"
|
|
97
|
-
? "sessionStorageSet"
|
|
98
|
-
: "localStorageSet";
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
type: action,
|
|
102
|
-
options: {
|
|
103
|
-
content: {
|
|
104
|
-
[namespace]: {
|
|
105
|
-
[keyName]: entry.id,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const screenStateProducer = (entry: ZappFeed) => {
|
|
113
|
-
entry.id = entry.extensions?.tag || entry.id;
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
type: "screenSetVariable",
|
|
117
|
-
options: {
|
|
118
|
-
key,
|
|
119
|
-
value: entry.id,
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const producer =
|
|
125
|
-
decoratedFeed.extensions?.preference_editor_options?.scope === "screen"
|
|
126
|
-
? screenStateProducer
|
|
127
|
-
: localStorageProducer;
|
|
128
|
-
|
|
129
|
-
decoratedFeed.entry?.forEach((entry: ZappEntry) => {
|
|
130
|
-
entry.type.value = "action";
|
|
131
|
-
|
|
132
|
-
entry.extensions = {
|
|
133
|
-
...(entry.extensions || {}),
|
|
134
|
-
tap_actions: {
|
|
135
|
-
actions: [producer(entry)],
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
return decoratedFeed;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export const decorateFeed = (feed: ZappFeed) => {
|
|
144
|
-
if (!(feed.extensions?.["role"] === "preference_editor")) {
|
|
145
|
-
return feed;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const key = feed.extensions?.["preference_editor_options"]?.["key"];
|
|
149
|
-
|
|
150
|
-
if (!key) {
|
|
151
|
-
log_error(
|
|
152
|
-
`decorateFeed: No 'key' provided in feed titled "${feed.title}" with id "${feed.id}" in preference_editor_options. The preference_editor role requires a key for local storage.`
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
throw new Error(
|
|
156
|
-
"decorateFeed: No 'key' provided in feed preference_editor_options"
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const decoratedFeed = R.clone(feed);
|
|
161
|
-
|
|
162
|
-
const isSingleSelect =
|
|
163
|
-
(feed.extensions?.["preference_editor_options"]?.select_mode ||
|
|
164
|
-
feed.extensions?.["behavior"]?.select_mode) === "single";
|
|
165
|
-
|
|
166
|
-
if (isSingleSelect) {
|
|
167
|
-
return makeSingleSelect(feed, key, decoratedFeed);
|
|
168
|
-
} else {
|
|
169
|
-
return makeMultiSelect(feed, key, decoratedFeed);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { ScreenStateResolver } from "../appUtils/contextKeysManager/contextResolver";
|
|
3
|
-
import { useScreenStateStore } from "../reactHooks/navigation/useScreenStateStore";
|
|
4
|
-
|
|
5
|
-
export const useScreenResolvers = () => {
|
|
6
|
-
const screenStateStore = useScreenStateStore();
|
|
7
|
-
|
|
8
|
-
return useMemo(() => {
|
|
9
|
-
return { screen: new ScreenStateResolver(screenStateStore) };
|
|
10
|
-
}, [screenStateStore]);
|
|
11
|
-
};
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject } from "rxjs";
|
|
2
|
-
import { SingleValueProvider } from "./StorageSingleSelectProvider";
|
|
3
|
-
import { createLogger } from "../logger";
|
|
4
|
-
import { bridgeLogger } from "../../zapp-react-native-bridge/logger";
|
|
5
|
-
|
|
6
|
-
export const { log_debug, log_error } = createLogger({
|
|
7
|
-
category: "ScreenSingleValueProvider",
|
|
8
|
-
subsystem: "zapp-react-native-bridge",
|
|
9
|
-
parent: bridgeLogger,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export class ScreenSingleValueProvider implements SingleValueProvider {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
private valueSubject: BehaviorSubject<string | null>;
|
|
15
|
-
private screenStateStoreUnsubscribe: (() => void) | null = null;
|
|
16
|
-
|
|
17
|
-
private static providers: Record<
|
|
18
|
-
string,
|
|
19
|
-
Record<string, SingleValueProvider>
|
|
20
|
-
> = {};
|
|
21
|
-
|
|
22
|
-
public static getProvider(
|
|
23
|
-
key: string,
|
|
24
|
-
screenRoute: string,
|
|
25
|
-
screenStateStore: ScreenStateStore
|
|
26
|
-
): SingleValueProvider {
|
|
27
|
-
if (!key) {
|
|
28
|
-
throw new Error("ScreenSingleValueProvider: Key is required");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (!screenRoute) {
|
|
32
|
-
throw new Error("ScreenSingleValueProvider: Screen route is required");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (!screenStateStore) {
|
|
36
|
-
throw new Error(
|
|
37
|
-
"ScreenSingleValueProvider: screen state store is required"
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!this.providers[screenRoute]) {
|
|
42
|
-
this.providers[screenRoute] = {};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
if (!this.providers[screenRoute][key]) {
|
|
47
|
-
this.providers[screenRoute][key] = new ScreenSingleValueProvider(
|
|
48
|
-
key,
|
|
49
|
-
screenRoute,
|
|
50
|
-
screenStateStore
|
|
51
|
-
);
|
|
52
|
-
} else {
|
|
53
|
-
(
|
|
54
|
-
this.providers[screenRoute][key] as ScreenSingleValueProvider
|
|
55
|
-
).updateStore(screenStateStore);
|
|
56
|
-
}
|
|
57
|
-
} catch (error) {
|
|
58
|
-
log_error("Failed to create provider", { key, screenRoute, error });
|
|
59
|
-
throw error;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return this.providers[screenRoute][key];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
private constructor(
|
|
67
|
-
private key: string,
|
|
68
|
-
route: string,
|
|
69
|
-
private screenStateStore: ScreenStateStore
|
|
70
|
-
) {
|
|
71
|
-
if (!key) {
|
|
72
|
-
throw new Error("ScreenSingleValueProvider: Key is required");
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!screenStateStore) {
|
|
76
|
-
throw new Error(
|
|
77
|
-
"ScreenSingleValueProvider: screen state store is required"
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
this.key = key;
|
|
82
|
-
this.valueSubject = new BehaviorSubject<string | null>(null);
|
|
83
|
-
|
|
84
|
-
this.setupScreenStateSubscription();
|
|
85
|
-
|
|
86
|
-
void this.getValueAsync();
|
|
87
|
-
|
|
88
|
-
log_debug("ScreenSingleValueProvider: Initializing", { key, route });
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
private updateStore(screenStateStore: ScreenStateStore): void {
|
|
92
|
-
this.cleanup();
|
|
93
|
-
this.screenStateStore = screenStateStore;
|
|
94
|
-
this.setupScreenStateSubscription();
|
|
95
|
-
void this.getValueAsync();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
private setupScreenStateSubscription(): void {
|
|
99
|
-
this.screenStateStoreUnsubscribe = this.screenStateStore.subscribe(
|
|
100
|
-
(state) => ({
|
|
101
|
-
value: state.data[this.key],
|
|
102
|
-
exists: this.key in state.data,
|
|
103
|
-
}),
|
|
104
|
-
(current, previous) => {
|
|
105
|
-
if (!current.exists && previous.exists) {
|
|
106
|
-
log_debug(
|
|
107
|
-
`ScreenSingleValueProvider: Key deleted from store: ${this.key}`
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
// TODO: If we need to handle deletion, we can do it here
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (current.value !== previous.value) {
|
|
114
|
-
this.valueSubject.next(current.value || null);
|
|
115
|
-
|
|
116
|
-
log_debug(`ScreenSingleValueProvider: Key updated: ${this.key}`, {
|
|
117
|
-
previous: previous.value,
|
|
118
|
-
current: current.value,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
log_debug(
|
|
125
|
-
`ScreenSingleValueProvider: screen state store subscription setup for key: ${this.key}`
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
private cleanup(): void {
|
|
130
|
-
if (this.screenStateStoreUnsubscribe) {
|
|
131
|
-
this.screenStateStoreUnsubscribe();
|
|
132
|
-
this.screenStateStoreUnsubscribe = null;
|
|
133
|
-
|
|
134
|
-
log_debug(
|
|
135
|
-
`ScreenSingleValueProvider: Unsubscribed from screen state store for key: ${this.key}`
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
clearValue(): Promise<void> {
|
|
141
|
-
this.screenStateStore.getState().removeValue(this.key);
|
|
142
|
-
this.valueSubject.next(null);
|
|
143
|
-
|
|
144
|
-
log_debug(`clearValue: value cleared for key: ${this.key}`);
|
|
145
|
-
|
|
146
|
-
return Promise.resolve();
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
getObservable(): BehaviorSubject<string | null> {
|
|
150
|
-
return this.valueSubject;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
getValue(): string | null {
|
|
154
|
-
return this.valueSubject.value;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
getValueAsync(): Promise<string | null> {
|
|
158
|
-
const currentValue = this.screenStateStore.getState().data[this.key];
|
|
159
|
-
const value = currentValue || null;
|
|
160
|
-
const selected = this.getValue();
|
|
161
|
-
const valuesAreEqual = value === selected;
|
|
162
|
-
|
|
163
|
-
const bothEmpty =
|
|
164
|
-
(value === null || value === "") &&
|
|
165
|
-
(selected === null || selected === "");
|
|
166
|
-
|
|
167
|
-
if (!this.valueSubject.closed && !valuesAreEqual && !bothEmpty) {
|
|
168
|
-
this.valueSubject.next(value);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return Promise.resolve(value);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
setValue(value: string): Promise<void> {
|
|
175
|
-
this.screenStateStore.getState().setValue(this.key, value);
|
|
176
|
-
this.valueSubject.next(value);
|
|
177
|
-
|
|
178
|
-
log_debug(`setValue: value set for key: ${this.key}`, { value });
|
|
179
|
-
|
|
180
|
-
return Promise.resolve();
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// TODO: remove if not needed
|
|
184
|
-
|
|
185
|
-
public static cleanupRoute(screenRoute: string): void {
|
|
186
|
-
if (this.providers[screenRoute]) {
|
|
187
|
-
Object.values(this.providers[screenRoute]).forEach((provider) => {
|
|
188
|
-
(provider as ScreenSingleValueProvider).destroy();
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
delete this.providers[screenRoute];
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// TODO: remove if not needed
|
|
196
|
-
|
|
197
|
-
public destroy(): void {
|
|
198
|
-
this.valueSubject.complete();
|
|
199
|
-
this.cleanup();
|
|
200
|
-
}
|
|
201
|
-
}
|