Overview & Architecture
Applied to a gateway element via data-ln-couchdb-connector inside a coordinator tree, ln-couchdb-connector encapsulates all CouchDB connection parameters (base URL, database name, auth credentials, and headers). It listens for database request CustomEvents (ln-couchdb-connector:request-sync, create, update, delete, bulk-delete), queries CouchDB _changes feeds with sequence tokens for delta synchronization, and maps id to _id/_rev on mutations via REST fetch() calls. Upon resolution, it emits ln-couchdb-connector:fetched or mutation response events to the parent coordinator.
In the decoupled 3-tier data lifecycle of ln-ashlar, this Transport Gateway encapsulates CouchDB-specific changes feeds and bulk documents protocols seamlessly, keeping local IndexedDB stores and UI widgets completely network-agnostic.
Dynamic CouchDB Synchronization
Mutating data-ln-couchdb-url, data-ln-couchdb-db, data-ln-couchdb-auth, or custom headers directly on the DOM element at runtime will instantly re-evaluate the instance configuration via dynamic MutationObservers and dispatch ln-couchdb-connector:config-changed.
Interactive Playground & Telemetry
1. Mutation Observer (Dynamic Attributes)
Change these attributes in real-time to watch the MutationObserver hot-reload the connector configuration instantly.
2. Event Trigger Panel & Methods
Dispatch CustomEvents to trigger CouchDB queries or use the programmatic JS API directly.