@mud-classic/react
v0.0.4
Published
React tools for MUD client.
Downloads
13
Readme
MUD React
React hooks (and more) for building MUD clients.
useComponentValue
Returns the value of the component for the entity, and triggers a re-render as the component is added/removed/updated.
const position = useComponentValue(Position, entity);
useEntityQuery
Returns all matching EntityIndex
es for a given entity query, and triggers a re-render as new query results come in.
const entities = useEntityQuery([Has(Position)]);
const playersAtPosition = useEntityQuery([Has(Player), HasValue(Position, { x: 0, y: 0 })]);