observer
Installation
SKILL.md
Observer
Installation: If not already installed, add the packages:
pnpm add @efesto-cloud/observable(providesObservable)pnpm add @efesto-cloud/publisher(peer dependency for subscription management)
Use this skill when you need reactive state or pub/sub.
Quick Rule
Observable: hold state (get/set) and notify on change.Publisher: emit events (notify) without storing state.
Procedure
- If you need current value + updates, use
Observable. - If you need fire-and-forget events, use
Publisher. - Always clean subscriptions (
unsubscribeor returned cleanup fn).
Common Mistakes
- Using
Publisheras if it stores state.
Related skills
More from efesto-cloud/lib
usecase
>
3entity
Create or modify domain entities using the @efesto-cloud/entity package. Use this skill whenever the user asks to add a new entity, update an existing entity, add properties or methods to an entity, or work on the entity/dto layer. Trigger when the user says things like "create a Foo entity", "add a field to Bar", "I need a new domain object", or "add entity X". Also trigger for DTO creation or modification.
3persistence
>
3type-enum-dict
|
3monad-maybe
Use when writing or reviewing code that returns Maybe<T> from the @efesto-cloud/maybe package.
3value-object
|
3