aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/ensnare.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-08-16 01:50:53 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-08-16 01:50:53 +0800
commit6895d330ffdf0f071e4df3fb9da47f2ea6fc7491 (patch)
tree64e170d2bd39434674e0c92bb637fd1d2c57debc /app/scripts/lib/ensnare.js
parentcb0c1f25bacab5f6ee9348dbc3dc112f4d77560f (diff)
parent271e3c4fdf1a86a989d642c18815d7f6537ed951 (diff)
downloadtangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.tar
tangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.tar.gz
tangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.tar.bz2
tangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.tar.lz
tangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.tar.xz
tangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.tar.zst
tangerine-wallet-browser-6895d330ffdf0f071e4df3fb9da47f2ea6fc7491.zip
Merge master.
Diffstat (limited to 'app/scripts/lib/ensnare.js')
-rw-r--r--app/scripts/lib/ensnare.js24
1 files changed, 0 insertions, 24 deletions
diff --git a/app/scripts/lib/ensnare.js b/app/scripts/lib/ensnare.js
deleted file mode 100644
index 6100f7c79..000000000
--- a/app/scripts/lib/ensnare.js
+++ /dev/null
@@ -1,24 +0,0 @@
-module.exports = ensnare
-
-// creates a proxy object that calls cb everytime the obj's properties/fns are accessed
-function ensnare (obj, cb) {
- var proxy = {}
- Object.keys(obj).forEach(function (key) {
- var val = obj[key]
- switch (typeof val) {
- case 'function':
- proxy[key] = function () {
- cb()
- val.apply(obj, arguments)
- }
- return
- default:
- Object.defineProperty(proxy, key, {
- get: function () { cb(); return obj[key] },
- set: function (val) { cb(); obj[key] = val; return val },
- })
- return
- }
- })
- return proxy
-}