ALPHA 0.1.0
let mustang = engine: true chassis: true owner: name: 'Duck Sauce' age: 19 location: 'Mondo' // turbo-charge your object let gt500 = // assign some subscribers// .subscribe (propertiesToSubscribe, callback) let mechanic = gt500 // callback ran after subscription // > 'mechanic available' let electrician = gt500 // > 'electrician available' // do some updates gt500 // > 'mechanic at work' gt500 // > 'mechanic at work'// > 'electrician at work' // subscribe deeply let owner = gt500 gt500 // > { name: 'Sammy Bananas', age: 19, location: 'Mondo' } // replace the value for the updated properties,// differently from .update(), which mergers.// in this case only .owner gets replaced, so// .engine, .chassis and .electronics are intact gt500 // owner callback in ran because the property it was// subscribed to, .owner.name, got affected by .replace() // > { firstName: 'Duke', lastName: 'Dumont' } gt500 // no callback ran, .owner.name property was// not affected, as it no longer exists, and// there are no subscribers for owner.firstName // if in the future .owner.name gets added back// than the owner callback will be ran again // if you want to replace the whole state,// in this case not only .owner, use .replaceAll() gt500 // > 'mechanic at work'// > 'electrician at work'