-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathremote-module-events.ts
38 lines (30 loc) · 995 Bytes
/
remote-module-events.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { LoadRemoteModuleOptions } from "@angular-architects/module-federation";
export const enum RemoteModuleEventTypes {
Loading = 'Loading',
Loaded = 'Loaded',
Failed = 'Failed',
}
export type RemoteModuleEvent = RemoteModuleLoading | RemoteModuleLoaded | RemoteModuleFailed;
export class RemoteModuleLoading {
public constructor(
public readonly id: string,
public readonly options: LoadRemoteModuleOptions,
) { }
public readonly type = RemoteModuleEventTypes.Loading;
}
export class RemoteModuleLoaded {
public constructor(
public readonly id: string,
public readonly options: LoadRemoteModuleOptions,
public readonly webpackModule: any,
) { }
public readonly type = RemoteModuleEventTypes.Loaded;
}
export class RemoteModuleFailed {
public constructor(
public readonly id: string,
public readonly options: LoadRemoteModuleOptions,
public readonly error: Error,
) { }
public readonly type = RemoteModuleEventTypes.Failed;
}