const activeLoaderIds = new Set<string>();

export const registerActiveLoader = (loaderId: string) => {
  activeLoaderIds.add(loaderId);
};

export const unregisterActiveLoader = (loaderId: string) => {
  activeLoaderIds.delete(loaderId);
};

export const isActiveLoader = (
  loaderId: string | null | undefined,
): boolean => {
  if (!loaderId) return false;
  return activeLoaderIds.has(loaderId);
};
