import { cache } from "react";

import { getDashboard } from "./api";

export const loadDashboard = cache(getDashboard);

export const loadAssistants = cache(() =>
  loadDashboard().then(d => d.assistants)
);
export const loadCompatibility = cache(() =>
  loadDashboard().then(d => d.compatibilityActions)
);
export const loadMeditations = cache(() =>
  loadDashboard().then(d => d.meditations)
);
export const loadPalms = cache(() => loadDashboard().then(d => d.palmActions));
export const loadPortraits = cache(() =>
  loadDashboard().then(d => d.partnerPortraits || [])
);
