Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

370 B
Raw Blame
import { createContext, use } from 'react';

import { type EntityDataApi } from './useEntityData';

export const EntityDataContext = createContext<EntityDataApi | null>(null);

export const useEntityDataContext = () => {
  const value = use(EntityDataContext);
  if (!value) throw new Error('useEntityDataContext must be used inside MemoryEntities');
  return value;
};