{"repo":"pmndrs/koota","free":true,"listed":false,"github":"https://github.com/pmndrs/koota","clone":"git clone https://github.com/pmndrs/koota.git","description":"🌎 Performant real-time state management for React and TypeScript","language":"TypeScript","stars":713,"topics":["data-oriented-design","data-oriented-programming","ecs","javascript","react","typescript","entity-component-system","game-development"],"license":"ISC","category":"game-templates","readme_excerpt":"Koota is an ECS-based state management library optimized for real-time apps, games, and XR experiences. Use as much or as little as you need. The official AI agent skill can be installed from this repo. Read more about skills here. First, define traits Traits are the building blocks of your state. They represent slices of data with specific meanings. Spawn entities Entities are spawned in a world. By adding traits to an entity they gain content. Query and update data Queries fetch entities sharing traits (archetypes). Use them to batch update entities efficiently. Use in your React components Traits can be used reactively inside of React components. Modify Koota state safely with actions Use actions to safely modify Koota from inside of React in either effects or events. Or access world directly and use it. Advanced Relations Koota supports relations between entities using the relation function. Relations allow you to build graphs by creating connections between entities with efficient queries. A relation is typically owned by the entity that needs to express it. The source is the entity that has the relation added, and the target is the entity it points to. In child.add(ChildOf(parent)) , child is the source and parent is the target. This design means the parent doesn't need to know about its children, instead children care about their parent, optimzing batch queries. With data Relations can contain data like any trait. Auto destroy Relations can automatically destroy relate","default_branch":null,"files":null,"tree":[],"storefront":"/r/pmndrs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pmndrs/koota/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}