@equinor/fusion-framework-module-widget 9.0.2 → 9.0.4
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/CHANGELOG.md +185 -162
- package/dist/esm/Widget.js +3 -2
- package/dist/esm/Widget.js.map +1 -1
- package/dist/esm/WidgetModuleConfigurator.js.map +1 -1
- package/dist/esm/WidgetModuleProvider.js.map +1 -1
- package/dist/esm/enable-widget-module.js.map +1 -1
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/module.js.map +1 -1
- package/dist/esm/state/actions.js.map +1 -1
- package/dist/esm/state/create-reducer.js.map +1 -1
- package/dist/esm/state/create-state.js.map +1 -1
- package/dist/esm/state/flows.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Widget.d.ts +5 -5
- package/dist/types/WidgetModuleConfigurator.d.ts +1 -1
- package/dist/types/WidgetModuleProvider.d.ts +4 -4
- package/dist/types/enable-widget-module.d.ts +1 -1
- package/dist/types/module.d.ts +3 -3
- package/dist/types/state/actions.d.ts +2 -2
- package/dist/types/state/create-reducer.d.ts +1 -1
- package/dist/types/state/create-state.d.ts +2 -2
- package/dist/types/state/flows.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/utils.d.ts +2 -2
- package/dist/types/version.d.ts +1 -1
- package/package.json +13 -13
- package/src/Widget.ts +295 -294
- package/src/WidgetModuleConfigurator.ts +45 -45
- package/src/WidgetModuleProvider.ts +144 -144
- package/src/enable-widget-module.ts +10 -10
- package/src/errors.ts +52 -56
- package/src/events.ts +51 -51
- package/src/module.ts +23 -23
- package/src/state/actions.ts +56 -56
- package/src/state/create-reducer.ts +33 -33
- package/src/state/create-state.ts +10 -10
- package/src/state/flows.ts +57 -57
- package/src/types.ts +38 -38
- package/src/utils.ts +44 -44
- package/src/version.ts +1 -1
package/src/events.ts
CHANGED
|
@@ -3,73 +3,73 @@ import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framewo
|
|
|
3
3
|
import type { Widget } from './Widget';
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
WidgetConfig,
|
|
7
|
+
WidgetManifest,
|
|
8
|
+
WidgetModulesInstance,
|
|
9
|
+
WidgetScriptModule,
|
|
10
10
|
} from './types';
|
|
11
11
|
|
|
12
12
|
/** base event type for applications */
|
|
13
13
|
export type WidgetEventInit<TDetail extends Record<string, unknown> | unknown = unknown> =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
FrameworkEventInit<
|
|
15
|
+
/** additional event details and key of target event */
|
|
16
|
+
TDetail & { name: string },
|
|
17
|
+
/** source of the event */
|
|
18
|
+
Widget
|
|
19
|
+
>;
|
|
20
20
|
|
|
21
21
|
export type WidgetEvent<TDetail extends Record<string, unknown> | unknown = unknown> =
|
|
22
|
-
|
|
22
|
+
FrameworkEvent<WidgetEventInit<TDetail>>;
|
|
23
23
|
|
|
24
24
|
export type WidgetEventFailure = FrameworkEvent<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
WidgetEventInit<{
|
|
26
|
+
error: WidgetConfig;
|
|
27
|
+
}>
|
|
28
28
|
>;
|
|
29
29
|
|
|
30
30
|
declare module '@equinor/fusion-framework-module-event' {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
interface FrameworkEventMap {
|
|
32
|
+
/** fired when the application has initiated its modules */
|
|
33
|
+
onWidgetModulesLoaded: WidgetEvent<{
|
|
34
|
+
/** initiated modules for application */
|
|
35
|
+
modules: WidgetModulesInstance;
|
|
36
|
+
}>;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
onWidgetManifestLoad: WidgetEvent;
|
|
39
|
+
/** fired when the application has loaded corresponding manifest */
|
|
40
|
+
onWidgetManifestLoaded: WidgetEvent<{
|
|
41
|
+
manifest: WidgetManifest;
|
|
42
|
+
}>;
|
|
43
|
+
onWidgetManifestFailure: WidgetEventFailure;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
onWidgetConfigLoad: WidgetEvent;
|
|
46
|
+
/** fired when the application has loaded corresponding config */
|
|
47
|
+
onWidgetConfigLoaded: WidgetEvent<{
|
|
48
|
+
config: WidgetConfig;
|
|
49
|
+
}>;
|
|
50
|
+
onWidgetConfigFailure: WidgetEventFailure;
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
/** fired when the application has loaded corresponding javascript module */
|
|
53
|
+
onAWidgetScriptLoad: WidgetEvent;
|
|
54
|
+
onWidgetScriptLoaded: WidgetEvent<{
|
|
55
|
+
script: WidgetScriptModule;
|
|
56
|
+
}>;
|
|
57
|
+
onWidgetScriptFailure: WidgetEventFailure;
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
/** fired before application loads manifest, config and script */
|
|
60
|
+
onWidgetInitialize: WidgetEvent;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
/**
|
|
63
|
+
* fired after application has loaded manifest, config and script
|
|
64
|
+
*
|
|
65
|
+
* __note:__ not fired until all loaders has settled (last emit)
|
|
66
|
+
*/
|
|
67
|
+
onWidgetInitialized: WidgetEvent;
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
/** fired when application fails to load either manifest, config and script */
|
|
70
|
+
onWidgetInitializeFailure: WidgetEventFailure;
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
/** fired when the application is disposed (unmounts) */
|
|
73
|
+
onWidgetDispose: FrameworkEvent<WidgetEventInit>;
|
|
74
|
+
}
|
|
75
75
|
}
|
package/src/module.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { Module } from '@equinor/fusion-framework-module';
|
|
2
|
-
import { ModuleDeps } from './types';
|
|
1
|
+
import type { Module } from '@equinor/fusion-framework-module';
|
|
2
|
+
import type { ModuleDeps } from './types';
|
|
3
3
|
|
|
4
4
|
import { WidgetModuleConfigurator } from './WidgetModuleConfigurator';
|
|
5
|
-
import { IWidgetModuleProvider, WidgetModuleProvider } from './WidgetModuleProvider';
|
|
5
|
+
import { type IWidgetModuleProvider, WidgetModuleProvider } from './WidgetModuleProvider';
|
|
6
6
|
|
|
7
7
|
export const moduleKey = 'widget';
|
|
8
8
|
|
|
9
9
|
export type WidgetModule = Module<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
typeof moduleKey,
|
|
11
|
+
IWidgetModuleProvider,
|
|
12
|
+
WidgetModuleConfigurator,
|
|
13
|
+
ModuleDeps
|
|
14
14
|
>;
|
|
15
15
|
|
|
16
16
|
export const module: WidgetModule = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
name: moduleKey,
|
|
18
|
+
configure() {
|
|
19
|
+
const config = new WidgetModuleConfigurator();
|
|
20
|
+
return config;
|
|
21
|
+
},
|
|
22
|
+
initialize: async (args) => {
|
|
23
|
+
const config = await args.config.createConfigAsync(args);
|
|
24
|
+
const event = await args.requireInstance('event').catch(() => undefined);
|
|
25
|
+
return new WidgetModuleProvider({ config, event });
|
|
26
|
+
},
|
|
27
|
+
dispose: (args) => {
|
|
28
|
+
(args.instance as unknown as WidgetModuleProvider).dispose();
|
|
29
|
+
},
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export default module;
|
|
33
33
|
|
|
34
34
|
declare module '@equinor/fusion-framework-module' {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
interface Modules {
|
|
36
|
+
[moduleKey]: WidgetModule;
|
|
37
|
+
}
|
|
38
38
|
}
|
package/src/state/actions.ts
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
type ActionInstanceMap,
|
|
3
|
+
type ActionTypes,
|
|
4
|
+
createAction,
|
|
5
|
+
createAsyncAction,
|
|
6
6
|
} from '@equinor/fusion-observable';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import type {
|
|
8
|
+
GetWidgetParameters,
|
|
9
|
+
WidgetConfig,
|
|
10
|
+
WidgetManifest,
|
|
11
|
+
WidgetModulesInstance,
|
|
12
|
+
WidgetScriptModule,
|
|
13
13
|
} from '../types';
|
|
14
14
|
|
|
15
15
|
const createActions = () => ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
16
|
+
/** Manifest loading */
|
|
17
|
+
setManifest: createAction('set_manifest', (manifest: WidgetManifest, update?: boolean) => ({
|
|
18
|
+
payload: manifest,
|
|
19
|
+
meta: {
|
|
20
|
+
created: Date.now(),
|
|
21
|
+
update,
|
|
22
|
+
},
|
|
23
|
+
})),
|
|
24
|
+
fetchManifest: createAsyncAction(
|
|
25
|
+
'fetch_manifest',
|
|
26
|
+
(payload: { key: string; args?: GetWidgetParameters['args'] }, update?: boolean) => ({
|
|
27
|
+
payload,
|
|
28
|
+
meta: { update },
|
|
29
|
+
}),
|
|
30
|
+
(manifest: WidgetManifest) => ({ payload: manifest }),
|
|
31
|
+
(error: unknown) => ({ payload: error }),
|
|
32
|
+
),
|
|
33
|
+
/** Config loading */
|
|
34
|
+
setConfig: createAction('set_config', (config: WidgetConfig) => ({ payload: config })),
|
|
35
|
+
fetchConfig: createAsyncAction(
|
|
36
|
+
'fetch_config',
|
|
37
|
+
(payload: { key: string; args?: GetWidgetParameters['args'] }, update?: boolean) => ({
|
|
38
|
+
payload,
|
|
39
|
+
meta: { update },
|
|
40
|
+
}),
|
|
41
|
+
(config: WidgetConfig) => ({ payload: config }),
|
|
42
|
+
(error: unknown) => ({ payload: error }),
|
|
43
|
+
),
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
|
+
setModule: createAction('set_module', (module: any) => ({ payload: module })),
|
|
46
|
+
importWidget: createAsyncAction(
|
|
47
|
+
'import_widget',
|
|
48
|
+
(entrypoint: string) => ({ payload: entrypoint }),
|
|
49
|
+
(module: WidgetScriptModule) => ({ payload: module }),
|
|
50
|
+
(error: unknown) => ({ payload: error }),
|
|
51
|
+
),
|
|
52
|
+
// widget Instance
|
|
53
|
+
setInstance: createAction('set_instance', (instance: WidgetModulesInstance) => ({
|
|
54
|
+
payload: instance,
|
|
55
|
+
})),
|
|
56
|
+
initialize: createAsyncAction(
|
|
57
|
+
'initialize_widget',
|
|
58
|
+
() => ({ payload: null }),
|
|
59
|
+
() => ({ payload: null }),
|
|
60
|
+
(error: unknown) => ({ payload: error }),
|
|
61
|
+
),
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
export const actions = createActions();
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
getBaseType,
|
|
3
|
+
createReducer as makeReducer,
|
|
4
|
+
isCompleteAction,
|
|
5
|
+
isRequestAction,
|
|
6
6
|
} from '@equinor/fusion-observable';
|
|
7
7
|
|
|
8
8
|
import { enableMapSet } from 'immer';
|
|
9
9
|
|
|
10
10
|
enableMapSet();
|
|
11
11
|
|
|
12
|
-
import { Actions, actions } from './actions';
|
|
13
|
-
import { WidgetStateInitial, WidgetState } from '../types';
|
|
12
|
+
import { type Actions, actions } from './actions';
|
|
13
|
+
import type { WidgetStateInitial, WidgetState } from '../types';
|
|
14
14
|
|
|
15
15
|
export const createReducer = (value: WidgetStateInitial) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
makeReducer<WidgetState, Actions>({ ...value, status: new Set() } as WidgetState, (builder) =>
|
|
17
|
+
builder
|
|
18
|
+
.addCase(actions.setManifest, (state, action) => {
|
|
19
|
+
if (action.meta.update) {
|
|
20
|
+
state.manifest = { ...state.manifest, ...action.payload };
|
|
21
|
+
} else {
|
|
22
|
+
state.manifest = action.payload;
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
.addCase(actions.setConfig, (state, action) => {
|
|
26
|
+
state.config = action.payload;
|
|
27
|
+
})
|
|
28
|
+
.addCase(actions.setModule, (state, action) => {
|
|
29
|
+
state.modules = action.payload;
|
|
30
|
+
})
|
|
31
|
+
.addCase(actions.setInstance, (state, action) => {
|
|
32
|
+
state.instance = action.payload;
|
|
33
|
+
})
|
|
34
|
+
/** mark status as loading {{type}} */
|
|
35
|
+
.addMatcher(isRequestAction, (state, action) => {
|
|
36
|
+
state.status.add(getBaseType(action.type));
|
|
37
|
+
})
|
|
38
|
+
/** clear status {{type}} */
|
|
39
|
+
.addMatcher(isCompleteAction, (state, action) => {
|
|
40
|
+
state.status.delete(getBaseType(action.type));
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
43
|
|
|
44
44
|
export default createReducer;
|
|
@@ -5,17 +5,17 @@ import { createReducer } from './create-reducer';
|
|
|
5
5
|
import { handleFetchManifest, handleImportWidget, handleFetchConfig } from './flows';
|
|
6
6
|
|
|
7
7
|
import type { Actions } from './actions';
|
|
8
|
-
import { WidgetState, WidgetStateInitial } from '../types';
|
|
9
|
-
import WidgetModuleProvider from '../WidgetModuleProvider';
|
|
8
|
+
import type { WidgetState, WidgetStateInitial } from '../types';
|
|
9
|
+
import type WidgetModuleProvider from '../WidgetModuleProvider';
|
|
10
10
|
|
|
11
11
|
export const createState = (
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
value: WidgetStateInitial,
|
|
13
|
+
provider: WidgetModuleProvider,
|
|
14
14
|
): FlowSubject<WidgetState, Actions> => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const reducer = createReducer(value);
|
|
16
|
+
const state = new FlowSubject<WidgetState, Actions>(reducer);
|
|
17
|
+
state.addFlow(handleFetchManifest(provider));
|
|
18
|
+
state.addFlow(handleImportWidget());
|
|
19
|
+
state.addFlow(handleFetchConfig(provider));
|
|
20
|
+
return state;
|
|
21
21
|
};
|
package/src/state/flows.ts
CHANGED
|
@@ -6,70 +6,70 @@ import { actions } from './actions';
|
|
|
6
6
|
import type { Flow } from '@equinor/fusion-observable';
|
|
7
7
|
|
|
8
8
|
import type { Actions } from './actions';
|
|
9
|
-
import { WidgetState } from '../types';
|
|
9
|
+
import type { WidgetState } from '../types';
|
|
10
10
|
import type WidgetModuleProvider from '../WidgetModuleProvider';
|
|
11
11
|
|
|
12
12
|
export const handleFetchManifest =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
(provider: WidgetModuleProvider): Flow<Actions, WidgetState> =>
|
|
14
|
+
(action$) =>
|
|
15
|
+
action$.pipe(
|
|
16
|
+
filter(actions.fetchManifest.match),
|
|
17
|
+
switchMap((action) => {
|
|
18
|
+
const {
|
|
19
|
+
payload: { key, args },
|
|
20
|
+
meta: { update },
|
|
21
|
+
} = action;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
);
|
|
39
|
-
}),
|
|
23
|
+
const subject = from(provider.getWidgetManifest(key, args)).pipe(
|
|
24
|
+
filter((x) => !!x),
|
|
25
|
+
share(),
|
|
26
|
+
);
|
|
27
|
+
return concat(
|
|
28
|
+
subject.pipe(map((manifest) => actions.setManifest(manifest, update))),
|
|
29
|
+
subject.pipe(
|
|
30
|
+
last(),
|
|
31
|
+
map((manifest) => actions.fetchManifest.success(manifest)),
|
|
32
|
+
),
|
|
33
|
+
).pipe(
|
|
34
|
+
catchError((err) => {
|
|
35
|
+
console.error(err, action.payload);
|
|
36
|
+
return of(actions.fetchManifest.failure(err));
|
|
37
|
+
}),
|
|
40
38
|
);
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
41
|
|
|
42
42
|
export const handleFetchConfig =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
52
|
-
return concat(
|
|
53
|
-
subject.pipe(map((manifest) => actions.setConfig(manifest))),
|
|
54
|
-
subject.pipe(
|
|
55
|
-
last(),
|
|
56
|
-
map((manifest) => actions.fetchConfig.success(manifest)),
|
|
57
|
-
),
|
|
58
|
-
).pipe(
|
|
59
|
-
catchError((err) => {
|
|
60
|
-
return of(actions.fetchConfig.failure(err));
|
|
61
|
-
}),
|
|
62
|
-
);
|
|
63
|
-
}),
|
|
43
|
+
(provider: WidgetModuleProvider): Flow<Actions, WidgetState> =>
|
|
44
|
+
(action$) =>
|
|
45
|
+
action$.pipe(
|
|
46
|
+
filter(actions.fetchConfig.match),
|
|
47
|
+
switchMap(({ payload: { key, args } }) => {
|
|
48
|
+
const subject = from(provider.getWidgetConfig(key, args)).pipe(
|
|
49
|
+
filter((x) => !!x),
|
|
50
|
+
share(),
|
|
64
51
|
);
|
|
52
|
+
return concat(
|
|
53
|
+
subject.pipe(map((manifest) => actions.setConfig(manifest))),
|
|
54
|
+
subject.pipe(
|
|
55
|
+
last(),
|
|
56
|
+
map((manifest) => actions.fetchConfig.success(manifest)),
|
|
57
|
+
),
|
|
58
|
+
).pipe(
|
|
59
|
+
catchError((err) => {
|
|
60
|
+
return of(actions.fetchConfig.failure(err));
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
65
|
|
|
66
66
|
export const handleImportWidget = (): Flow<Actions, WidgetState> => (action$) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
action$.pipe(
|
|
68
|
+
filter(actions.importWidget.match),
|
|
69
|
+
switchMap(({ payload }) => {
|
|
70
|
+
return from(import(/* @vite-ignore */ payload)).pipe(
|
|
71
|
+
map(actions.importWidget.success),
|
|
72
|
+
catchError((err) => of(actions.importWidget.failure(err))),
|
|
73
|
+
);
|
|
74
|
+
}),
|
|
75
|
+
);
|