gpui-entity
OfficialMaster safe, reactive app state with entities.
Authorlongbridge
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Entity-based state management enables safe, reactive state across components, reducing boilerplate and preventing unsafe access patterns.
Core Features & Use Cases
- Read: read(cx) for immutable access to state.
- Read With: read_with(cx, |state, cx| ...) to access both state and context and return values.
- Update: update(cx, |state, cx| ...) to mutate state and trigger cx.notify().
- Weak References: downgrade() into WeakEntity<T> to avoid retain cycles in closures.
- Lifecycle & Async: automatic disposal when strong references are dropped; support for spawning async tasks via cx.spawn; safe updates with weak references.
- Use Cases: internal component state, shared state across components, parent-child coordination, and async state management.
Quick Start
Create an entity with cx.new and use the inner context in update closures for safe, reactive state management across components.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: gpui-entity Download link: https://github.com/longbridge/gpui-component/archive/main.zip#gpui-entity Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.