managed-object-proxy
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

managed-object-proxy

Build Status

What is it?

A managed object proxy that allows you listen to all changes in the object, including child object.

Quick start

import Watchable from "managed-object-proxy";

const proxy = new Watchable();
const obj = proxy.init({});

const listener = (v, where) => {
  if (typeof v === "object") {
    console.log(`> ${JSON.stringify(v)} @ ${where}`);
  } else {
    console.log(`> ${v} @ ${where}`);
  }
});

proxy.registerTrigger(listener);

// starting from here feel free to make any changes to the object.

proxy.unregisterTrigger(listener);

Documents

We currently not offering documents. To understand APIs please read the source code, it's not a large file.

/managed-object-proxy/

    Package Sidebar

    Install

    npm i managed-object-proxy

    Weekly Downloads

    8

    Version

    0.1.5

    License

    ISC

    Unpacked Size

    6.86 kB

    Total Files

    4

    Last publish

    Collaborators

    • misaka_0x447f