Data Coordinator

Mode

Skin

Theme

Overview & Decoupled Architecture

ln-data-coordinator is applied to a parent container (e.g. <ul data-ln-data-coordinator hidden>) enclosing an ln-data-store and a data transport connector (ln-api-connector, ln-couchdb-connector, or ln-websocket-connector). It catches store staleness and query requests to dispatch fetch events to the connector, delivering responses back to the store. On store mutations, it computes local queries and routes structured set-data events directly to bound presentation components (such as ln-table, ln-list, or ln-stat) without custom glue code.

The Orchestrator Doctrine

The Cache Store (data-ln-data-store) has zero network logic and only fires request-remote-* events. The Connector (data-ln-api-connector) only makes fetch requests. The parent Data Coordinator listens for the store's requests, applies bidirectional Ingress/Egress data schema restructuring, delegates requests to the connector, and confirms mutations back in the database.

Decoupled Setup Advantages

  • Zero-Coupling Code: You can completely swap the transport network layer (e.g. from REST API to CouchDB or WebSockets) without touching a single line of your database cache, forms, or data table markup.
  • Secure JS Mappers: Register mappers securely via window.lnCore.registerDataMapper() to map, flatten, or transform server schemas to clean local database schemas on the fly, keeping markup 100% CSP-compliant.

Declarative 3-Tier Markup (Copy/Paste)

Mock Network Backend Sandbox

This demo uses a virtual network interceptor simulating a live backend REST endpoint on /api/documents.

Interactive Documents Manager Usecase

IndexedDB-backed Documents Table

Title
Department
Status Size Author Last Updated
Actions

0 items in cache

3-Tier Local-First Event Telemetry (100% Real-Time)

Observe how the 3-Tier Data Layer interacts: Store events bubble UP, the Coordinator applies Ingress/Egress JS mappers, calls the Connector, and confirms back to IndexedDB.

Telemetry Stream