User
Example Usage
1import { chokidar } from "hbh-nodes";3const data = {4 user: { name: "Alice", age: 25 },5 items: [1, 2, 3],6 settings: new Map([['theme', 'dark']])7};9const watched = chokidar(data);11// Listen to updates12watched.user.on('update', (path, oldVal, newVal) => {13 console.log(`Updated ${path}:`, oldVal, '→', newVal);14});16watched.user.name = "Bob"; 17// Console: Updated user.name: Alice → Bob19// Listen to array changes20watched.items.on('update', (path, oldVal, newVal) => {21 console.log(`Array updated at ${path}:`, oldVal, '→', newVal);22});24watched.items.push(4); 25// Console: Array updated at items: [1,2,3] → [1,2,3,4]27// Listen to Map changes28watched.settings.on('add', (path, _, newVal) => {29 console.log(`Added to ${path}:`, newVal);30});32watched.settings.set('language', 'en'); 33// Console: Added to settings.get(language): en