No documents yet
Click New to create one.
Applied to a hidden element via data-ln-data-store id="name", ln-data-store initializes and queries an IndexedDB database (ln_app_cache) with schema indexing and optional AES-GCM encryption. It is completely blind to the network: it listens for request CustomEvents (ln-data-store:request-query, request-save, request-delete), resolves results against local records, and emits ln-data-store:stale when cached data exceeds its configured timeout.
Understanding local-first architecture in isolation is difficult. True appreciation comes from seeing a fully-wired CRUD application working flawlessly in real-world scenarios: syncing data instantly across tabs, queuing actions while offline, and automatically resolving server version conflicts (409) without freezing the UI.
This demo page illustrates the ultimate Local-First CRUD Pipeline in ln-ashlar, orchestrating five independent, highly-specialized components through standard DOM event channels:
Open this page in a second browser window side-by-side. Make a change in one window—it saves locally, pushes to the backend mock, and immediately broadcasts to the other window using delta events. The other tab’s data table repaints itself instantly. No manual polling or web socket servers needed.
ln-store): Renders nothing. Manages local IndexedDB storage, outbox write queues, delta sync loops, and optimistic states.
ln-table): Displays the records. It triggers query fetches, processes local column filters/sorting, renders templates, and captures selection events.
ln-form): Manages inputs. It handles native validation, block submissions, bulk-fills from row selections, and serializes updates.
ln-modal): Houses the editor form. It keeps focus trapped, responds to escape cancellations, and opens or closes on demand.
ln-confirm): Prevents accidental row deletions. It gates trash clicks in-place, arming and releasing actions cleanly.
All operations are mediated by a single, lightweight coordinator script at the bottom of the page. The coordinator coordinates queries, intercepts store mutations to refresh tables, handles toast notifications, and resolves complex 409 server conflicts dynamically by feeding merged payloads back into form fields.
— wipes localStorage + IndexedDB + reloads.
| Title |
Department |
Status | Size |
Updated |
Actions |
|---|
Click New to create one.
Try adjusting your search or filters.
The table, select, and stat counter below are wired purely via HTML attributes. No <script> block drives them — ln-data-coordinator binder handles initial load, filter delivery, and store-mutation refresh automatically.
Total: | Approved:
| Title |
Department |
Status | Updated |
|---|