vani-global-store

Create a tiny global store with explicit subscriptions

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "vani-global-store" with this command: npx skills add itsjavi/vani/itsjavi-vani-vani-global-store

Global Store with Subscriptions

Instructions for implementing a small store and wiring components to it.

When to Use

Use this when multiple components need shared state without implicit reactivity by default.

Steps

  1. Implement a store with getState, setState, and subscribe.
  2. In components, call handle.onBeforeMount() to subscribe once.
  3. On store updates, call handle.update() from the subscription.
  4. Keep mutations behind store commands to avoid stale views.

Arguments

  • stateShape - description of the state object (defaults to {})
  • storeFile - path to the store module (defaults to src/store.ts)
  • featureName - feature identifier for naming (defaults to App)

Examples

Example 1 usage pattern:

Create a counter store and a component that reads getState() during render.

Example 2 usage pattern:

Expose a setState command and update UI through subscriptions only.

Output

Example output:

Created: src/store.ts
Updated: src/counter.ts
Notes: handle.onBeforeMount() subscribes once and updates explicitly.

Present Results to User

Summarize store API, subscription wiring, and files changed.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

vani-forms-inputs

No summary provided by upstream source.

Repository SourceNeeds Review
General

vani-spa-setup

No summary provided by upstream source.

Repository SourceNeeds Review
General

vani-spa-app

No summary provided by upstream source.

Repository SourceNeeds Review
General

vani-scheduling

No summary provided by upstream source.

Repository SourceNeeds Review