{"size": 366, "ext": "js", "max_stars_repo_path": "Lab13/solution-dispatcher.js", "max_stars_repo_name": "vkumm/connect.tech-react-workshop", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Lab13/solution-dispatcher.js", "max_issues_repo_name": "vkumm/connect.tech-react-workshop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Lab13/solution-dispatcher.js", "max_forks_repo_name": "vkumm/connect.tech-react-workshop", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.5294117647, "max_line_length": 50, "alphanum_fraction": 0.6584699454}
let registeredCallbacks = {};

export const on = (channel, callback) => {
    registeredCallbacks[channel] = callback;
};

export const trigger = (channel, data) => {
    const callback = registeredCallbacks[channel];
    if (callback) {
        callback(data);
    }
};

export const removeCallback = (channel) => {
    registeredCallbacks[channel] = undefined;
};
