Toolverse
All skills

gpui-entity

by longbridge

Entity management and state handling in GPUI. Use when working with entities, managing component state, coordinating between components, handling async operations with state updates, or implementing reactive patterns. Entities provide safe concurrent access to application state.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Category
Frontend
Views
18

About this skill

Entity management and state handling in GPUI. Use when working with entities, managing component state, coordinating between components, handling async operations with state updates, or implementing reactive patterns. Entities provide safe concurrent access to application state.

How to use

  1. Zainstaluj skill w swoim projekcie GPUI, dodając go do konfiguracji Claude/Copilot dla tego repozytorium.
  2. Utwórz encję za pomocą cx.new(), przekazując inicjalizator stanu — na przykład cx.new(|cx| Counter { count: 0 }) tworzy encję licznika.
  3. Odczytaj stan encji za pomocą entity.read(cx), które zwraca immutable referencję do stanu, lub entity.read_with(cx, |state, cx| ...), jeśli chcesz przetworzyć dane w zamknięciu.
  4. Aktualizuj stan za pomocą entity.update(cx, |state, cx| { ... }), modyfikując pole stanu wewnątrz zamknięcia i wywołując cx.notify(), aby wyzwolić przerysowanie komponentu.
  5. Dla callbacków i zamknięć, które mogą przetrwać dłużej niż encja, utwórz słabą referencję za pomocą entity.downgrade(), która zwraca WeakEntity — ta nie zapobiega czyszczeniu i zwraca Result, bezpiecznie obsługując przypadek, gdy encja została już usunięta.
  6. Współdziel encję między komponentami, przekazując ją jako pole struktury komponentu — każdy komponent może niezależnie czytać i aktualizować ten sam stan, a cx.notify() zapewnia, że wszystkie komponenty się przerysują.

Related skills

interactive-dashboard-builder

by anthropics

Build self-contained interactive HTML dashboards with Chart.js, dropdown filters, and professional styling. Use when creating dashboards, building interactive reports, or generating shareable HTML files with charts and filters that work without a server.

Frontend
2298

mermaid-gen

by vladm3105

Generate syntactically correct Mermaid diagrams for technical documentation

Frontend
23124

shadcn-ui-setup

by maneeshanif

Install and configure Shadcn/ui component library with Radix UI primitives, Aceternity UI effects, set up components, and manage the component registry. Use when adding Shadcn/ui to a Next.js project or installing specific UI components for Phase 2.

Frontend
23167

brainstorming

by obra

Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative questioning, alternative exploration, and incremental validation. Don't use during clear 'mechanical' processes

Frontend
49170

google-official-seo-guide

by littleben

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

Frontend
101196

screenshot-to-code

by OneWave-AI

Convert UI screenshots into working HTML/CSS/React/Vue code. Detects design patterns, components, and generates responsive layouts. Use this when users provide screenshots of websites, apps, or UI designs and want code implementation.

Frontend
94209