on-change - Watch an object or array for changes

  •        18

It works recursively, so it will even detect if you modify a deep property like obj.a.b[0].c = true.Uses the Proxy API.

https://github.com/sindresorhus/on-change

Tags
Implementation
License
Platform

   




Related Projects

Watch.JS - watch the changes of any object or attribute

  •    Javascript

Watch.JS is a small library with a lot of possibilities. You may know that the "Observer" design pattern involves executing some function when an observed object changes. Other libraries exist that do this, but with Watch.JS you will not have to change the way you develop. Take a look at the examples to see how simple it is to add Watch.JS to your code. If you don't want to call a second watcher in the current scope just set WatchJS.noMore to true and it will be reset to false when this watcher finishes.

icaro - Smart and efficient javascript object observer, ideal for batching DOM updates (~1kb)

  •    Javascript

icaro is really fast compared to the other reactive libs because it smartly throttles all the state changes. icaro will let you listen to all the changes happening in a javascript object or array, grouping them efficiently, and optimizing the performance of your listeners.

negative-array - Negative array index support `array[-1]` using ES2015 Proxy

  •    Javascript

JavaScript doesn't natively support the use of a negative index to get items backwards from the end, but with ES2015 Proxy it's possible. Take a look at the source to see how simple it is to implement and read this short article about it.Proxies are objects for which the programmer has to define the semantics in JavaScript. The default object semantics are implemented in the JavaScript engine, often written in lower-level languages like C++. Proxies let the programmer define most of the behavior of an object in JavaScript. They are said to provide a meta-programming API.

Watchman - A File Watching Service

  •    C

Watchman exists to watch files and record when they change. It can also trigger actions (such as rebuilding assets) when matching files change. It can recursively watch one or more directory trees. It does not follow symlinks. It knows they exist, but they show up the same as any other file in its reporting. You can query a root for file changes since you last checked, or the current state of the tree. You can subscribe to file changes that occur in a root.

proxy-polyfill - Proxy object polyfill

  •    Javascript

This is a polyfill for the Proxy object, part of ES6. See the MDN docs or Introducing ES2015 Proxies for more information on Proxy itself. Unlike other polyfills, this does not require Object.observe, which is deprecated. The polyfill supports just a limited number of proxy 'traps'. It also works by calling seal on the object passed to Proxy. This means that the properties you want to proxy must be known at creation time.


goproxy - Proxy is a high performance HTTP(S), websocket, TCP, UDP,Secure DNS, Socks5 proxy server implemented by golang

  •    Go

Pull Request is welcomed. First, you need to clone the project to your account, and then modify the code on the dev branch. Finally, Pull Request to dev branch of goproxy project, and contribute code for efficiency. PR needs to explain what changes have been made and why you change them. This page is the v6.0 manual, and the other version of the manual can be checked by the following link.

awesome-es2015-proxy - For learning how to use JavaScript Proxy, or just to see what is possible

  •    Javascript

🐐 For learning how to use JavaScript Proxy, or just to see what is possible through metaprogramming in modern JavaScript. Tries to collect resources such as presentations, articles, modules and examples using Proxy, Reflect and other intercession type metaprogramming. The Proxy object was included in the ES2015 iteration of the standard and is available in all evergreen browsers and Node.js v6. Unfortunately as it is a big language semantic change, it cannot be polyfilled through transpilers such as Babel.

gitwatch - Watch a git repository for changes

  •    Shell

gitwatch lets you watch a git repository for changes and run a custom command per change. I wrote this to keep track of certain Cyanogenmod features. gitwatch runs grep ... once for each new change since the last time it was run. If it's the first time, it will only clone the repo without running the command. The command is fed the output of git diff. $GW_TO is the commit that introduced the change. Some other environmental variables are also set (see the comment on top of the script).

PySyft - A Library for Private, Secure, Multi-Owner Deep Learning - Currently Pre Alpha

  •    Python

PySyft is a Python library for secure, private Deep Learning. PySyft decouples private data from model training, using Multi-Party Computation (MPC) over PyTorch and tensorflow. Join the movement on Slack. The container mount the examples folder on a volume so every change on the notebooks is persistent. Furthermore the container is deleted when it is stopped, in a way to facilitate development. You just have to change PySyft code, and run the run_docker.sh script to observe changes you've made on notebooks.

babel-watch - Reload your babel-node app on JS source file changes. And do it fast.

  •    Javascript

Reload your babel-node app on JS source file changes. And do it fast. If you're tired of using babel-node together with nodemon (or similar solution). The reason why the aforementioned setup performs so badly is the startup time of babel-node itself. babel-watch only starts babel in the "master" process where it also starts the file watcher. The transpilation is performed in that process too. On file-watcher events, it spawns a pure node process and passes transpiled code from the parent process together with the source maps. This allows us to avoid loading babel and all its deps every time we restart the JS script/app.

sentineljs - Detect new DOM nodes using CSS selectors (650 bytes)

  •    Javascript

SentinelJS is a tiny JavaScript library that lets you detect new DOM nodes using CSS selectors (650 bytes). SentinelJS uses dynamically-defined CSS animation rules (@keyframes) to hook into browser animationstart events when a new node matching a given CSS selector is added to the DOM. In general this should be more performant than using a Mutation Observer to watch the entire document tree for changes and iterating through all new child nodes recursively. SentinelJS performs one hash key lookup on calls to the animationstart event so the performance overhead is minimal. If you define the animation-name property on a CSS rule that overlaps with the selector in your SentinelJS watch function then only one of those animations will be called which could cause unexpected behavior. To get around this you can trigger SentinelJS watches from your CSS using custom animation names (see below).

proxy-fun - For learning how to use JavaScript Proxy, or just to see what is possible

  •    Javascript

🐐 For learning how to use JavaScript Proxy, or just to see what is possible through metaprogramming in modern JavaScript. Tries to collect resources such as presentations, articles, modules and examples using Proxy, Reflect and other intercession type metaprogramming. The Proxy object was included in the ES2015 iteration of the standard and is available in all evergreen browsers and Node.js v6. Unfortunately as it is a big language semantic change, it cannot be polyfilled through transpilers such as Babel.

THObserversAndBinders - Easy, lightweight, object-based key-value observing (KVO) and key-value binding (KVB) for iOS and Mac OS X

  •    Objective-C

Now, it seems like every Cocoa programmer out there has their own KVO and KVB solution, and I've tried a few of them. There are too many to enumerate here. Many of them are quite nice, but I couldn't find any that passed my personal 'feels comfortable' test with flying colours (and, though I know it's irrational, KVO just seems like it should be cleaner than a messily prefixed category on NSObject, objc_setAssociatedObject() or method swizzling). I like this API. It's one simple call to set up an block that fires when a property changes. Want to observe a whole bunch of things? Just set up a bunch ofTHObservers, store them in an array, then when it comes time to stop observing, release the array (maybe calling -stopObserving on the observers in the array first if there might be a reference to them lying around elsewhere, like in an autorelease pool).

monitor-table-change-with-sqltabledependency - Get SQL Server notification on record table change

  •    CSharp

SqlTableDependency is a high-level C# component used to audit, monitor and receive notifications on SQL Server's record table changes. For any record table change, as insert, update or delete operation, a notification containing values for the record changed is delivered to SqlTableDependency. This notification contains insert, update or delete record values. This table record tracking change system has the advantage to avoid a select to retrieve updated table record, because the updated table values record is delivered by notification.

Watcher - Watcher is a daemon that watches specified files/folders for changes and fires commands in response to those changes

  •    Python

The first time you start it (if you haven't done it yourself) it will create ~/.watcher and ~/.watcher/jobs.yml and then it will yell at you. You need to edit ~/.watcher/jobs.yml to setup folders to watch. You'll find a jobs.yml in the same directory as this README. Use that as an example. It should be pretty simple. If you edit ~/.watcher/jobs.yml you must restart the daemon for it to reload the configuration file. It'd make sense for me to set up watcher to watch the config file. That'll be coming soon.

deadsimple-less-watch-compiler - A nodejs script that allows you to watch a folder for changes and compile the less css files into another folder

  •    Javascript

A command that watches folders(and subfolders) for file changes and automatically compile the less css files into css. This is a file system watcher and compiler. It also keep track of a dependency tree and recompiles the parent if an imported (child) LESS file is changed. Install LESS and make sure the lessc binary is accessible to the script. Installing LESS with the -g(global) flag will make the binary accessible to your system.

ember-changeset - Ember.js flavored changesets, inspired by Ecto

  •    Javascript

The idea behind a changeset is simple: it represents a set of valid changes to be applied onto any Object (Ember.Object, DS.Model, POJOs, etc). Each change is tested against an optional validation, and if valid, the change is stored and applied when executed. Given Ember's Data Down, Actions Up (DDAU) approach, a changeset is more appropriate compared to implicit 2 way bindings. Other validation libraries only validate a property after it is set on an Object, which means that your Object can enter an invalid state.

Debezium - Stream changes from your databases.

  •    Java

Debezium is a distributed platform that turns your existing databases into event streams, so applications can see and respond immediately to each row-level change in the databases. Debezium is built on top of Apache Kafka and provides Kafka Connect compatible connectors that monitor specific database management systems. Debezium records the history of data changes in Kafka logs, from where your application consumes them. This makes it possible for your application to easily consume all of the events correctly and completely.

kubespy - Tools for observing Kubernetes resources in real time, powered by Pulumi.

  •    Go

kubespy is a small tool that makes it easy to observe how Kubernetes resources change in real time, derived from the work we did to make Kubernetes deployments predictable in Pulumi's CLI. Run kubespy at any point in time, and it will watch and report information about a Kubernetes resource continuously until you kill it. kubespy trace deployment nginx will "trace" the complex changes a complex Kubernetes resource makes in the cluster (in this case, a Deployment called nginx), and aggregate them into a high-level summary, which is updated in real time.

scala.rx - An experimental library for Functional Reactive Programming in Scala

  •    Scala

Scala.Rx is an experimental change propagation library for Scala. Scala.Rx gives you Reactive variables (Rxs), which are smart variables who auto-update themselves when the values they depend on change. The underlying implementation is push-based FRP based on the ideas in Deprecating the Observer Pattern. Apart from basic change-propagation, Scala.Rx provides a host of other functionality, such as a set of combinators for easily constructing the dataflow graph, compile time checks for a high degree of correctness, and seamless interop with existing Scala code. This means it can be easily embedded in an existing Scala application.