From the same booking/scheduling app. objectsStore/objectsProvider
cache reference data (statuses, models, tenants, roles) that's fetched once
and shared across many feature components, avoiding repeated fetches for
data that rarely changes.
objectsStore.ts— a Zustand store holding reference data plus per-resource loading/error state.objectsProvider.tsx— fetches each reference resource (guarded by session readiness) and pushes results into the store via oneuseEffectper resource.useFetch.ts— a small wrapper arounduseSWRthat also tracksisInitialLoad, so callers can distinguish "first load" from "revalidating in the background."filterDateLogic.ts— date/time formatting and conversion helpers (ISO,de-DElocale, Excel serial dates) consolidated in one module instead of being reimplemented per component.
@/context/appContext(tenant/global-scope context) — referenced but defined elsewhere in the original app.
objectsProvider uses one useEffect per resource rather than a single
effect watching an array of results, so a failure or update in one resource
(e.g. roles) can't accidentally skip processing another (e.g. tenants).