@tririga/cra-template
Version:
Quickstart Create React App (CRA) template for building TRIRIGA UX Web applications using ReactJS and IBM Carbon Components.
16 lines (13 loc) • 406 B
JavaScript
import { LoadingServices } from ".";
import { CurrentUserDS } from "../model";
let currentUser = null;
export async function getCurrentUser() {
if (currentUser != null) return currentUser;
try {
LoadingServices.setLoading("currentUser", true);
currentUser = await CurrentUserDS.getCurrentUser();
} finally {
LoadingServices.setLoading("currentUser", false);
}
return currentUser;
}