/*!
 * KoliBri - The accessible HTML-Standard
 */
'use strict';

let currentLocation;
const subscribers = [];
const setCurrentLocation = (location) => {
    currentLocation = location;
    subscribers.forEach((subscriber) => {
        subscriber(location);
    });
};
const onLocationChange = (callback, eager = true) => {
    if (eager && typeof currentLocation === 'string') {
        callback(currentLocation);
    }
    subscribers.push(callback);
    return () => {
        const index = subscribers.indexOf(callback);
        if (index >= 0) {
            subscribers.splice(index, 1);
        }
    };
};

exports.onLocationChange = onLocationChange;
exports.setCurrentLocation = setCurrentLocation;
//# sourceMappingURL=ariaCurrentService-3051l6MI.js.map

//# sourceMappingURL=ariaCurrentService-3051l6MI.js.map