Now.js Framework Documentation
CoreObserver
CoreObserver
CoreObserver - Central MutationObserver for the Now.js framework Provides a single, optimized MutationObserver that managers can register handlers with. This eliminates multiple observers and provides consistent DOM change handling. // Register handler for added nodes CoreObserver.onAdd('[data-component]', (element) => { ComponentManager.mount(element); }); // Register handler for removed nodes CoreObserver.onRemove('[data-table]', (element) => { TableManager.destroyTable(element.dataset.table); });
Generated from source on 2026-08-21. Descriptions come from JSDoc in the file.
Re-rundocs_scaffoldwhen the code changes; hand edits are lost on regeneration
Source
- File:
Now/js/CoreObserver.js(383 lines) - Form: object literal (singleton)
Public methods (9)
destroy()
Disconnect and cleanup
getDebugInfo()
Get debug info
handleMutations(mutations)
Handle mutations from MutationObserver
init(options = {})
Initialize the observer
off(selector, callback = null)
Unregister handler
onAdd(selector, callback, options = {})
Register handler for added nodes matching selector
onRemove(selector, callback, options = {})
Register handler for removed nodes matching selector
processPending()
Process pending mutations in batch
scheduleBatch()
Schedule batch processing
Data attributes used
data-table
Depends on
ComponentManager · EventManager · TableManager
Events
| Event | When Triggered | Detail |
|---|---|---|
coreobserver:init |
CoreObserver started | {timestamp} |