Skip to content

A tool for watching an object for changes using Proxies.

License

Notifications You must be signed in to change notification settings

allain/proxy-watched

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxy Watched

Proxy Watched is a tool for watching an object for changes, even if they are deep ones.

I explicitly don't want to know what the change was, so that's not tracked.

Usage

import proxyWatched from 'proxy-watched'
const obj = { a: 'a' }
const watched = proxyWatched(a, () => changes ++)
watched.a = 'A' // changes => 1
watched.b = 'B' // changes => 2

// supports arrays
watched.names = ['Bob', 'Bill'] // changes => 3
watched.names.push('Bobby') // changes => 4

About

A tool for watching an object for changes using Proxies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published