## Current Behavior Atomized Groups are treated just like any other groups in the PDV ## Expected Behavior We want to let people know that something was created by the Atomizer and also surface more information to users.
25 lines
601 B
TypeScript
25 lines
601 B
TypeScript
let externalApiService: ExternalApiService | null = null;
|
|
|
|
export function getExternalApiService() {
|
|
if (!externalApiService) {
|
|
externalApiService = new ExternalApiService();
|
|
}
|
|
|
|
return externalApiService;
|
|
}
|
|
|
|
export class ExternalApiService {
|
|
private subscribers: Set<(event: { type: string; payload?: any }) => void> =
|
|
new Set();
|
|
|
|
postEvent(event: { type: string; payload?: any }) {
|
|
this.subscribers.forEach((subscriber) => {
|
|
subscriber(event);
|
|
});
|
|
}
|
|
|
|
subscribe(callback: (event: { type: string; payload: any }) => void) {
|
|
this.subscribers.add(callback);
|
|
}
|
|
}
|