MCPcopy Create free account
hub / github.com/anomalyco/console / assertActor

Function assertActor

packages/core/src/actor.ts:49–56  ·  view source on GitHub ↗
(type: T)

Source from the content-addressed store, hash-verified

47export const withActor = ActorContext.with;
48
49export function assertActor<T extends Actor["type"]>(type: T) {
50 const actor = useActor();
51 if (actor.type !== type) {
52 throw new Error(`Expected actor type ${type}, got ${actor.type}`);
53 }
54
55 return actor as Extract<Actor, { type: T }>;
56}
57
58export function useWorkspace() {
59 const actor = useActor();

Callers 6

server.tsFile · 0.90
account.tsFile · 0.90
local.tsFile · 0.90
index.tsFile · 0.90
search.tsFile · 0.90
workspacesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected