Skip to content

afeiship/create-proxy

Repository files navigation

create-proxy

Create proxy with callback.

version license size download

installation

npm install @jswork/create-proxy

usage

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);
});

license

Code released under the MIT license.