Socket
Book a DemoInstallSign in
Socket

object-observable-lite

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-observable-lite

Observe object changes deeply without cloning in an efficient manner.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
10
233.33%
Maintainers
1
Weekly downloads
 
Created
Source

object-observable-lite

Observe object changes deeply without cloning in an efficient manner.

Goals

The package must observe deeply. The package must not clone the nested objects. The package must handle all types. The package should attempt to minimize overhead

Caveats

Returned changes are not cloned. Instances and therefore will mutate as the observed object mutates

object-observable

This is a derivative of object-observable with many of the features striped for improved performance.

Package Comparison

Several similar packages were tested which resulted in this package being created. The comparison of these packages can be seen here.

Package Comparison

Usage

const objectObservableLite = require('object-observable-lite');

const obj = testObj = {
  x: 1,
  foo: {
    y: 1,
  },
  bar: ['a', { b: 'b' }],
  today: new Date(),
};

const watchedObject = objectObservableLite(obj, (change) => {
  console.log(change)
});

watchedObject.x = 2;

Opportunities for Improvements

The comparison of other packages suggests there is still room for improvement in the overall efficiency of this package.

Other packages will have to be more deeply analyzed to determine how this package could be improved.

Contributing

Pull request are welcome.

Keywords

observe

FAQs

Package last updated on 07 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.