@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
28 lines (26 loc) • 751 B
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
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);
}
};
};
export { onLocationChange as o, setCurrentLocation as s };
//# sourceMappingURL=ariaCurrentService.js.map
//# sourceMappingURL=ariaCurrentService.js.map