Create proxy with callback.
npm install @jswork/create-proxy
import createProxy from '@jswork/create-proxy';
const person = {
name: 'John Doe',
age: 42,
nationality: 'American',
};
const state = createProxy(person, (target, key, newValue)=>{
const oldValue = target[key];
console.log(newValue, oldValue, key, target);
});
Code released under the MIT license.