0.0.4 • Published 3 months ago

@mud-classic/react v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

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 EntityIndexes 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 })]);
0.0.3

3 months ago

0.0.2

3 months ago

0.0.4

3 months ago

0.0.1

3 months ago