Skip to content

Instantly share code, notes, and snippets.

View vitamink's full-sized avatar

David Kirkland vitamink

  • HexLab Ltd
  • Aichi, Japan
  • 21:15 (UTC +09:00)
View GitHub Profile
@vitamink
vitamink / Object.prototype.watch.js
Created November 20, 2017 17:12 — forked from adriengibrat/Object.prototype.watch.js
Object.prototype.watch "polyfill"
/**
* Object.prototype.watch polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch
*
* Known limitations:
* - `delete object[property]` will remove the watchpoint
*
* Based on Eli Grey gist https://gist.github.com/eligrey/384583
* Impovements based on Xose Lluis gist https://gist.github.com/XoseLluis/4750176
* This version is optimized for minification