Creates typed hooks bound to a specific world config.
Call once at module scope with your world type, then use the returned hooks in components anywhere under the EcsContext.Provider.
EcsContext.Provider
const ecs = ECSpresso.create() .withResourceTypes<{ score: number; health: number }>() .withEventTypes<{ enemyKilled: { id: number } }>() .build();type ECS = typeof ecs;const { useResource, useEvent, useEcs } = createEcsHooks<ECS>(); Copy
const ecs = ECSpresso.create() .withResourceTypes<{ score: number; health: number }>() .withEventTypes<{ enemyKilled: { id: number } }>() .build();type ECS = typeof ecs;const { useResource, useEvent, useEcs } = createEcsHooks<ECS>();
Creates typed hooks bound to a specific world config.
Call once at module scope with your world type, then use the returned hooks in components anywhere under the
EcsContext.Provider.