import { PublisherInitializer, SubscriptorInitializer } from "./event-orchestrators.js";
function registerEventSources(events, eventSources) {
  eventSources.forEach((source) => {
    const initializer = new PublisherInitializer(source.topicsToPublish);
    initializer.initializeMap((t) => events.register(t));
    source.publishers = initializer;
  });
}
function registerEventSubscribers(events, eventSubscribers) {
  eventSubscribers.forEach((subscriber) => {
    const initializer = new SubscriptorInitializer(subscriber.topicsToSubscribe);
    initializer.initializeMap((t) => ({
      subscribe: (handler) => events.subscribe(t, handler, subscriber.id)
    }));
    subscriber.subscriptors = initializer;
  });
}
export {
  registerEventSources,
  registerEventSubscribers
};
//# sourceMappingURL=orchestrate-events.js.map
