@grafana/runtime
Version:
Grafana Runtime Library
17 lines (15 loc) • 461 B
JavaScript
let singletonInstance = null;
function setCurrentUser(instance) {
if (singletonInstance) {
throw new Error("User should only be set once, when Grafana is starting.");
}
singletonInstance = instance;
}
function getCurrentUser() {
if (!singletonInstance) {
throw new Error("User can only be used after Grafana instance has started.");
}
return singletonInstance;
}
export { getCurrentUser, setCurrentUser };
//# sourceMappingURL=user.mjs.map