{"size": 425, "ext": "js", "max_stars_repo_path": "SeenIt/src/helpers/observer.js", "max_stars_repo_name": "LyuboslavKrastev/React-JS", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "SeenIt/src/helpers/observer.js", "max_issues_repo_name": "LyuboslavKrastev/React-JS", "max_issues_repo_issues_event_min_datetime": "2020-07-16T20:46:56.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T22:42:42.000Z", "max_forks_repo_path": "SeenIt/src/helpers/observer.js", "max_forks_repo_name": "LyuboslavKrastev/React-JS", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 19, "max_forks_count": null, "avg_line_length": 28.3333333333, "max_line_length": 86, "alphanum_fraction": 0.6211764706}
let subscriptions = { 
    'loginUser': [],
    'logoutUser': [],
    'notification': [],
};

export default { // event-driven architecture
    events: {
        loginUser: 'loginUser',
        logoutUser: 'logoutUser',
        notification: 'notification'
    },
    subscribe: (eventName, func) => subscriptions[eventName].push(func),
    trigger: (eventName, data) => subscriptions[eventName].forEach(func => func(data))
}