💥 Breaking Change
ObserveObject
removed- Added
observable
function which makes object observable. In this case, the function returns the same object.
const obj = {
a: 1,
b: {
c: 5
}
};
const obsObj = Jodit.modules.observable(obj);
console.log(obj === obsObj); // true
obsObj.on('change', () => {
console.log('Object changed');
});
obsObj.on('change.a', () => {
console.log('Key a changed');
});
obsObj.on('change.b.c', () => {
console.log('Key b.c changed');
});
obj.a = 6;
// Object changed
// Key a changed
obj.b = { c: 6 };
// Object changed
obj.b.c = 8;
// Object changed
// Key b.c changed
🐛 Bug Fix
- Fixed autotest in Chrome on Windows