Skip to content

Set up global store (Zustand) #16

@lornakelly

Description

@lornakelly

Summary

Introduce a centralized Zustand store for the editor and wire it into the Diagram Editor component so it can consume, modify, and observe application state in a structured and extensible way.

Goals

  • Establish a single source of truth for editor state.
  • Define a clean state shape for MVP.

Non-Goals

  • Full state architecture finalization.
  • Advanced middleware (undo/redo, devtools, etc. — can come later).
  • Complex performance optimization.

Description

1️⃣ Create Editor Store

  • Add a Zustand-based store under src/store/
  • The store should define initial state.

2️⃣ Provide Store via Context

  • Expose the store via a Provider (if required by chosen architecture).
  • Ensure the DiagramEditor component can:
    • Read state from the store
    • Trigger state updates
    • Subscribe to changes

Testing

  • Add at least one unit test for:
    • Store initialization
    • A basic action updating state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions