production-evyos-systems-an.../docs/frontDocs/contexts/component_contexts.md

572 B

Context

Syncs each step of user's session with redis backend.

// Create the config hook using the factory
const useContextConfig = createContextHook<ClientPageConfig>({
  endpoint: "/context/page/config",
  contextName: "config",
  enablePeriodicRefresh: false,
});

// Wrapper hook that adapts the generic hook to the expected interface
export function useConfig(): UseConfigResult {
  const { data, isLoading, error, refresh, update } = useContextConfig();
  return {
    configData: data,
    isLoading,
    error,
    refresh,
    update,
  };
}