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).