observer

Installation
SKILL.md

Observer

Installation: If not already installed, add the packages:

  • pnpm add @efesto-cloud/observable (provides Observable)
  • 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

  1. If you need current value + updates, use Observable.
  2. If you need fire-and-forget events, use Publisher.
  3. Always clean subscriptions (unsubscribe or returned cleanup fn).

Common Mistakes

  • Using Publisher as if it stores state.
Related skills
Installs
3
First Seen
14 days ago