{"_id":"@cosium-oss/observable-slim","_rev":"5-46bb73a9bda638af3f1b0921508779ea","name":"@cosium-oss/observable-slim","dist-tags":{"latest":"0.1.13"},"versions":{"0.1.10":{"name":"@cosium-oss/observable-slim","description":"Observable Slim is a singleton that utilizes ES6 Proxies to observe changes made to an object and any nested children of that object. It is intended to assist with state management and one-way data binding.","version":"0.1.10","main":"observable-slim.js","devDependencies":{"babel-core":"6.26.0","babel-eslint":"8.2.3","babel-preset-es2015":"6.24.1","babel-register":"6.26.0","chai":"4.1.2","coveralls":"3.0.1","expect":"22.4.3","gulp":"3.9.0","gulp-babel":"7.0.1","gulp-eslint":"4.0.2","gulp-if":"2.0.2","gulp-istanbul":"1.1.3","gulp-mocha":"3.0.1","gulp-rename":"1.2.2","gulp-uglify":"3.0.0","gulp-useref":"3.1.5","nyc":"11.8.0","util":"0.10.3"},"babel":{"presets":["es2015"]},"scripts":{"test":"nyc mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/ElliotNB/observable-slim.git"},"license":"MIT","author":{"name":"ElliotNB"},"homepage":"https://github.com/ElliotNB/observable-slim","bugs":{"url":"https://github.com/ElliotNB/observable-slim/issues"},"gitHead":"315180936bf14cc34ed5e8a67c24cba4d58a28d7","_id":"@cosium-oss/observable-slim@0.1.10","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"},"dist":{"integrity":"sha512-qxu199LyyIM7kaUPASUM7Ln9F2ZtPAJGh8CGhNyarchXlz/C9AQC+jmzAZ2jgnHXcDvb4JU32DugiNLBO0V0cQ==","shasum":"cd5c25d101df72782aa74cfa18da3fa73d9c3098","tarball":"https://registry.npmjs.org/@cosium-oss/observable-slim/-/observable-slim-0.1.10.tgz","fileCount":12,"unpackedSize":83610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb7/o4CRA9TVsSAnZWagAAr/gP/iX+VhsHa7yK7MgpO5gC\nlu96u8CrdzT4aHrhT4JfM8l8X/0ERMlNU/n0I+9pRNYiQJyEBTuljlzETGl7\nsf10y5/fVAtGLhHnrYJqayTLrzkjUPC9j+tZYbsYmiYQ61vW3BI1r1dRRker\njfQ/Bq4m4J2pc5oscavUwZ1+aMgFszLQH9ETSGL7i/DImcz67P8F4elW6ujn\nx5qbXvt0Nx76Fx1R34LSGp3Pf1pJ7trNNbSlUGukjk320Feud6yLIyM9w6rz\n3LuvgDpniYOybZVfgOVkiqhQVc2E+q6l6FVdMOj3oFrQIUU8n3/CvYEhQVjS\n3JK7Z6Lg6QCxM28bhInAN082xeGPMtRQPBPQSJAIdb9JZtUd6gH4JD3Lacw/\nfoqfCFP7+DCOFP9ultBbBmAdituH9UnqcISkmpleCrwk+MrUq4XAS9Gnk9ff\nc7LH8gvnK5X+uEv4rT1QHOt4iaDXSakJCYDBAfA9SUtW0cQgW2/XPrCbTLg/\nS5Shlvau7P8UVuId+9ncgw5US4hKMDBPFJAa+lKpzXuf9Mg6jiU3sZEnms9A\nDpBGE+ltZo1O7FP4gudQV8xsvTmvh6+V4sq0SxsFGy2LhNrCugN/VWC/u1h/\nyBr5lpiDAl+J/8MmqGugGjm0qjG0r2WjwUeNZL/IuBbOFTDyT0Hgmd6R3fap\nBy47\r\n=QNZJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTd0PD6eCtLhcvYMrhQRAiipoMCtQci+9NEpdGKuEuPwIgYEwzSrJN+w8P0ijMCk2RNBQzEz/2KNd2XUK/RskUCpU="}]},"maintainers":[{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/observable-slim_0.1.10_1542453815671_0.8752775294963804"},"_hasShrinkwrap":false},"0.1.11":{"name":"@cosium-oss/observable-slim","description":"Observable Slim is a singleton that utilizes ES6 Proxies to observe changes made to an object and any nested children of that object. It is intended to assist with state management and one-way data binding.","version":"0.1.11","main":"observable-slim.js","devDependencies":{"babel-core":"6.26.0","babel-eslint":"8.2.3","babel-preset-es2015":"6.24.1","babel-register":"6.26.0","chai":"4.1.2","coveralls":"3.0.1","expect":"22.4.3","gulp":"3.9.0","gulp-babel":"7.0.1","gulp-eslint":"4.0.2","gulp-if":"2.0.2","gulp-istanbul":"1.1.3","gulp-mocha":"3.0.1","gulp-rename":"1.2.2","gulp-uglify":"3.0.0","gulp-useref":"3.1.5","nyc":"11.8.0","util":"0.10.3"},"babel":{"presets":["es2015"]},"scripts":{"test":"nyc mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/ElliotNB/observable-slim.git"},"license":"MIT","author":{"name":"ElliotNB"},"homepage":"https://github.com/ElliotNB/observable-slim","bugs":{"url":"https://github.com/ElliotNB/observable-slim/issues"},"gitHead":"2cd1c37de7bdc07c54b59a33a9f2e142c27f569d","_id":"@cosium-oss/observable-slim@0.1.11","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"},"dist":{"integrity":"sha512-qMffxBc3vwgPmTHVlAmaypbFFu7x4I6U7KD/JkKduWcuRTslyLSfNE4eTVPY9A8oHuMN2wdevKbniLsgZTzHdQ==","shasum":"123b4f6cd4a65bfbd3ccf118e11721f031cf8478","tarball":"https://registry.npmjs.org/@cosium-oss/observable-slim/-/observable-slim-0.1.11.tgz","fileCount":12,"unpackedSize":83954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8AGJCRA9TVsSAnZWagAAZ4IQAJS0+5vuqz4XimInptyG\nDll0NetER0C7RymAsLzaParktLsbbSUqJsL7D0zdfPVnZ6rgYR7RX7D52Z+h\nFIdmaEtu9d43M9pW1j2K7wqA/wuwzv+hlC9soXk+nDmHXb4sSE14h1/CT4Il\n/EbkESc3IyhR4vQ7qotQovWcn/9UZPfYDCSsS5wF/FcvG8FouxUR5ydAo2Vm\n+7WEqx3ehIAH/auCuc0HQrz4xsqKr7raJe92Z2LQil/dCH+OvmT1DvhycYFO\nloxNI5tvalfOyiiPZDF9YIohhr1Y7tpGRCB4U6PoV2IGUO9+zvTmu75URx0L\npWzbsPx0vSPINdLV2vfxBkgUyg8YNYbqUF3VgU7IqGD8g7IuwMjB5FRloKBy\n7b9YB7+rVKv++xgJrdbnDQHp6scqwmMX5DG4Oft9ChSSRTUu1Jxg3/0uteCZ\nQZX0Liubc6/d7pz5K8uDYE57bTHSTfU1IXITuwC5L8xyleJsR4yqTVY82Jmm\nlNY2v5nZQwIoWHdvEXigu+8/GhbetkycFRhDQYJp3FqhOO0SpZONcVfAuPrw\nXNsHxokOH6oaV/qudzf+pTJcdRNg4CY6m2iwsFCHCnfm0BY0r0zs+t0iHNjJ\nsHUxlOiOZNOkT0ncyuJGmVtn0rnSCsGsk57whqwSrFmnnszFebmZc/GJFjOP\nhX3o\r\n=xFsY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2Tymguqd2TBsZB8C7FQy2aTJJ2HSu0lHHmyBfeEXahAiEAwP3C+ARqyJqSL6QjOsu+2LJpUlPHeRJIP+gqV/XcnkA="}]},"maintainers":[{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/observable-slim_0.1.11_1542455688506_0.7927189369384116"},"_hasShrinkwrap":false},"0.1.12":{"name":"@cosium-oss/observable-slim","description":"Observable Slim is a singleton that utilizes ES6 Proxies to observe changes made to an object and any nested children of that object. It is intended to assist with state management and one-way data binding.","version":"0.1.12","main":"observable-slim.js","devDependencies":{"babel-core":"6.26.0","babel-eslint":"8.2.3","babel-preset-es2015":"6.24.1","babel-register":"6.26.0","chai":"4.1.2","coveralls":"3.0.1","expect":"22.4.3","gulp":"3.9.0","gulp-babel":"7.0.1","gulp-eslint":"4.0.2","gulp-if":"2.0.2","gulp-istanbul":"1.1.3","gulp-mocha":"3.0.1","gulp-rename":"1.2.2","gulp-uglify":"3.0.0","gulp-useref":"3.1.5","nyc":"11.8.0","util":"0.10.3"},"babel":{"presets":["es2015"]},"scripts":{"test":"nyc mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/ElliotNB/observable-slim.git"},"license":"MIT","author":{"name":"ElliotNB"},"homepage":"https://github.com/ElliotNB/observable-slim","bugs":{"url":"https://github.com/ElliotNB/observable-slim/issues"},"gitHead":"1e786900ecdf5daacf944025caadf4eb6d609182","_id":"@cosium-oss/observable-slim@0.1.12","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"},"dist":{"integrity":"sha512-St1Hxey5N2fgvkR77Eh2UallHn9KkqLzsutrRD/gU8SQrk3dl9/kTsR7kEDcNLnQtwjJYDtM5Vd3LvK91QWE4w==","shasum":"9c113abc4d62dbb2122a0c1fd4ac66fe602928b0","tarball":"https://registry.npmjs.org/@cosium-oss/observable-slim/-/observable-slim-0.1.12.tgz","fileCount":23,"unpackedSize":112809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8F19CRA9TVsSAnZWagAA+asQAIcm/zT0hQyytLXIVp2F\n0wReCZqoRGAen9wgoYCfUv+bar8i3acdqNDUHzuO6j2kr+R9l5NnqCuHcCQk\nU1ZgoGP9CBHZDa4wJr4/vVrmfvqaFlC720nrQ/Mt5gVTnCY+IkkESki5MyV4\n5uXvPiW5jbBRWI0cTTeMVSW1FjiJfH81hoYzkC3+ROdAywXzj8cmLO0aYoGK\n5TawBHgPar4cQHfMHA69MUNRvIuWWTxZTYm/JbkMz4c86ooljhyl1InNxU1C\nPIVLlAdWzc992P4pdseqH7RftuXB6/GzNGHe4QzY0/grPC6hLeU00GeYj8If\nHqeRjR8RJv0XLiJOtN9kDyCqhH1jxd7ljWaeDtuErEXvJSXH/k12S1is3kM/\nMt79+I0Tzo8rS1GgjWUe0fTQhNVNt45SYilRzJFjEsrgqo/1I4Haq4UAWaaA\niu/EBoAF+mqdi0434XfPXIUla7ek5hH2yFhUoc2aYKDHY+/73IZgstLMoTUT\nF6whvSjWZPlQEgCWlMZ3+BbYKJaAmihdR7Xqq+vvkOhOKNTZUHwdB3zN9TV4\nNW37cuKcnoKZ/ebbvFz3VRB4PUa0WRQbhuNZ897q06L+XJycCHjJRofccLHx\nWTSKZ3ELPwJHu2qngfyGMpySl6sW37m923FFVNyBoetfyTgNIamoJfjg6Xr0\n7HVb\r\n=FUgF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmrLrc+hvNAIDQZtpXuCxJz4P07yJSNKRo4mUVIfzMTAIhAIFZKTI4zvlPwTx3kCrB4UpnmRPOv1bEFI+Qt8d0XU5W"}]},"maintainers":[{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/observable-slim_0.1.12_1542479228137_0.8430113792216487"},"_hasShrinkwrap":false},"0.1.13":{"name":"@cosium-oss/observable-slim","description":"Observable Slim is a singleton that utilizes ES6 Proxies to observe changes made to an object and any nested children of that object. It is intended to assist with state management and one-way data binding.","version":"0.1.13","main":"observable-slim.js","devDependencies":{"babel-core":"6.26.0","babel-eslint":"8.2.3","babel-preset-es2015":"6.24.1","babel-register":"6.26.0","chai":"4.1.2","coveralls":"3.0.1","expect":"22.4.3","gulp":"3.9.0","gulp-babel":"7.0.1","gulp-eslint":"4.0.2","gulp-if":"2.0.2","gulp-istanbul":"1.1.3","gulp-mocha":"3.0.1","gulp-rename":"1.2.2","gulp-uglify":"3.0.0","gulp-useref":"3.1.5","nyc":"11.8.0","util":"0.10.3"},"babel":{"presets":["es2015"]},"scripts":{"test":"nyc mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"repository":{"type":"git","url":"git+https://github.com/ElliotNB/observable-slim.git"},"license":"MIT","author":{"name":"ElliotNB"},"homepage":"https://github.com/ElliotNB/observable-slim","bugs":{"url":"https://github.com/ElliotNB/observable-slim/issues"},"gitHead":"c0df805bfc56137565ca9cce5b873f7f85debac9","_id":"@cosium-oss/observable-slim@0.1.13","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"},"dist":{"integrity":"sha512-Gs6mjtCsFYD96l+REtkR8egRMkrF3uWMkxb1dRkAFdN3nccyBSy0+I74vWF4E39JPzayzxBKkabPKl1GXomgww==","shasum":"e3e6db867c57c1a5c9497880deb239cfd2ba6d0e","tarball":"https://registry.npmjs.org/@cosium-oss/observable-slim/-/observable-slim-0.1.13.tgz","fileCount":23,"unpackedSize":116203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8IvxCRA9TVsSAnZWagAA7PQP/jZBMXFiWxaw0I6UcMGl\n82e24IzIAYKT5oMyt4CBbRKG5fmw+1j+HtsM8J4/4OHx26khKN8BSUy9wgpM\noKaboCZZS4h2gKPPi6CtvVvzx/wNVj1AEGBU97tksnXemsrg0DyCi2eo9c9E\n7w6jAmrmItpB1k/V/bJPyE9hBtuFrRhVw6zvAfgh5xVErj4r870L7ghetAWQ\nLb3PrwmZxp8gPQ9/YSfuH5RZVq3xEmzBk6h6BuNY76z5EZ5FNb+4650xSfeq\nh0o3Kp/7ER86ue0zdsMAAC8PMAoeshOxunAh+hzMDcm0m14bChcIVDZYiJTD\niDwbupaZ56RZdtiLdKiYU3j0wP87hiTjkVdaDl9cycfBeOZ01JBJM6veDOWQ\nPsaimeGjQsvWNbW0he6+j7+4vFebVWa0jQR90cJPt7LnBeAl/kw6MsmWqa4c\nHsp+EFgZX2h3YSx/QftXZ9cykgxLbQr5lbCRoEE7NvY0yqnc2jJTiQNz4Hvo\nqj2RUK8njcqdXuRS8kNVlu8eFOmPIidp2PCP67l+S2d7h56p79P3ZKYp9Imj\n91HA5d9UuVTcVnmW8G9Ej/Dx/CIY36n3T595Khk+o88KPJhzlTXFuaO/4CAf\nRmiq4kDQjrDdjfQoYZtDQVwdGp820duM8pM9htUp/oOKYs4an0q74wmU3qUa\nO60R\r\n=YiNm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH3vvZJ+OI08CA2KNb8kVQk/+7Oxz0h3GOp/aI9XIsuYCIQC7r9HUJAhZPrHGr4VYMJrkp76r+O0GCVs2cK0auhGqtw=="}]},"maintainers":[{"name":"reda-alaoui","email":"alaoui.rda@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/observable-slim_0.1.13_1542491120947_0.18450773949584742"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-17T11:23:35.506Z","0.1.10":"2018-11-17T11:23:35.801Z","modified":"2022-04-05T01:26:19.831Z","0.1.11":"2018-11-17T11:54:48.657Z","0.1.12":"2018-11-17T18:27:08.271Z","0.1.13":"2018-11-17T21:45:21.129Z"},"maintainers":[{"email":"bmoulin@cosium.com","name":"bmoulin"},{"email":"alaoui.rda@gmail.com","name":"reda-alaoui"}],"description":"Observable Slim is a singleton that utilizes ES6 Proxies to observe changes made to an object and any nested children of that object. It is intended to assist with state management and one-way data binding.","homepage":"https://github.com/ElliotNB/observable-slim","repository":{"type":"git","url":"git+https://github.com/ElliotNB/observable-slim.git"},"author":{"name":"ElliotNB"},"bugs":{"url":"https://github.com/ElliotNB/observable-slim/issues"},"license":"MIT","readme":"# :eyes: Observable Slim\n\n[![Build Status](https://travis-ci.org/ElliotNB/observable-slim.svg?branch=master)](https://travis-ci.org/ElliotNB/observable-slim) [![Coverage Status](https://coveralls.io/repos/github/ElliotNB/observable-slim/badge.svg)](https://coveralls.io/github/ElliotNB/observable-slim)\n\nhttps://github.com/elliotnb/observable-slim\n\nVersion 0.1.1\n\nLicensed under the MIT license:\n\nhttp://www.opensource.org/licenses/MIT\n\n## Overview\nObservable Slim is a singleton that utilizes ES6 Proxies to observe changes made to an object\nand any nested children of that object. It is intended to assist with state management and one-way\ndata binding. Observable Slim aspires to be as lightweight and simple as possible. Minifies\ndown to roughly 3000 characters.\n\n## Install\n\n```html\n<script src=\"observable-slim.js\"></script>\n```\n\nAlso available via NPM:\n\n```\n$ npm install observable-slim\n```\n\n## Usage\n\n\n### Create an observer\n\nThe `create` method is the starting point for using Observable Slim. It is invoked to create a new ES6 Proxy\nwhose changes we can observe. The `create` method accepts three parameters:\n\n1. `target` - Object, required, plain JavaScript object that we want to observe for changes.\n2. `domDelay` - Boolean, required, if true, then Observable Slim will batch up observed changes to `target` on a 10ms delay (via `setTimeout`). If false, then `observer` will be immediately invoked after each individual change made to `target`. It is helpful to set `domDelay` to `true` when your `observer` function makes DOM manipulations (fewer DOM redraws means better performance).\n3. `observer` - Function, optional, will be invoked when a change is made to the proxy of `target`. When invoked, the `observer` function is passed a single argument -- an array detailing each change that has been made (see below).\n\nThe `create` method will return a standard ES6 Proxy.\n\n```javascript\nvar test = {};\nvar p = ObservableSlim.create(test, true, function(changes) {\n\tconsole.log(JSON.stringify(changes));\n});\n\np.hello = \"world\";   \n// Console log:\n// [{\"type\":\"add\",\"target\":{\"hello\":\"world\"},\"property\":\"hello\",\"newValue\":\"world\",\"currentPath\":\"hello\",\"jsonPointer\":\"/hello\",\"proxy\":{\"hello\":\"world\"}}]\n\np.hello = \"WORLD\";\n// Console log:\n// [{\"type\":\"update\",\"target\":{\"hello\":\"WORLD\"},\"property\":\"hello\",\"newValue\":\"WORLD\",\"previousValue\":\"world\",\"currentPath\":\"hello\",\"jsonPointer\":\"/hello\",\"proxy\":{\"hello\":\"WORLD\"}}]\n\np.testing = {};   \n// Console log:\n// [{\"type\":\"add\",\"target\":{\"hello\":\"WORLD\",\"testing\":{}},\"property\":\"testing\",\"newValue\":{},\"currentPath\":\"testing\",\"jsonPointer\":\"/testing\",\"proxy\":{\"hello\":\"WORLD\",\"testing\":{}}}]\n\np.testing.blah = 42;   \n// Console log:\n// [{\"type\":\"add\",\"target\":{\"blah\":42},\"property\":\"blah\",\"newValue\":42,\"currentPath\":\"testing.blah\",\"jsonPointer\":\"/testing/blah\",\"proxy\":{\"blah\":42}}]\n\np.arr = [];   \n// Console log:\n// [{\"type\":\"add\",\"target\":{\"hello\":\"WORLD\",\"testing\":{\"blah\":42},\"arr\":[]},\"property\":\"arr\",\"newValue\":[],\"currentPath\":\"arr\",\"jsonPointer\":\"/arr\",\"proxy\":{\"hello\":\"WORLD\",\"testing\":{\"blah\":42},\"arr\":[]}}]\n\np.arr.push(\"hello world\");   \n// Console log:\n// [{\"type\":\"add\",\"target\":[\"hello world\"],\"property\":\"0\",\"newValue\":\"hello world\",\"currentPath\":\"arr.0\",\"jsonPointer\":\"/arr/0\",\"proxy\":[\"hello world\"]}]\n\ndelete p.hello;  \n// Console log:\n// [{\"type\":\"delete\",\"target\":{\"testing\":{\"blah\":42},\"arr\":[\"hello world\"]},\"property\":\"hello\",\"newValue\":null,\"previousValue\":\"WORLD\",\"currentPath\":\"hello\",\"jsonPointer\":\"/hello\",\"proxy\":{\"testing\":{\"blah\":42},\"arr\":[\"hello world\"]}}]\n\np.arr.splice(0,1);   \n// Console log:\n// [{\"type\":\"delete\",\"target\":[],\"property\":\"0\",\"newValue\":null,\"previousValue\":\"hello world\",\"currentPath\":\"arr.0\",\"jsonPointer\":\"/arr/0\",\"proxy\":[]},\n// {\"type\":\"update\",\"target\":[],\"property\":\"length\",\"newValue\":0,\"previousValue\":1,\"currentPath\":\"arr.length\",\"jsonPointer\":\"/arr/length\",\"proxy\":[]}]\n\nconsole.log(JSON.stringify(test));   \n// Console log:\n// {\"testing\":{\"blah\":42},\"arr\":[]}\n\n```\n\n### Nested objects\n\nIf you wish to observe changes on a parent object and observe changes to an object nested on the parent, you may do so as follows:\n```javascript\nvar data = {\"testing\":{\"test\":{\"testb\":\"hello world\"},\"testc\":\"hello again\"},\"blah\":\"tree\"};\n\nvar p = ObservableSlim.create(data, true, function(changes) { console.log(\"First observable\");console.log(changes); });\nvar pp = ObservableSlim.create(data.testing, true, function(changes) { console.log(\"Second observable\");console.log(changes); });\nvar ppp = ObservableSlim.create(data.testing.test, true, function(changes) { console.log(\"Third observable\");console.log(changes); });\n```\n\n- A change to `ppp.testb` will trigger the callback on all three observables.\n- A change to `p.testing.test.testb` will also trigger the callback on all three observables.\n- A change to `pp.testc` will only trigger the first and second observable.\n- A change to `p.blah` will only trigger the first observable.\n\n### Add observers\n\nIf you wish to add a second observer function to the same object, you may do so as follows:\n```javascript\n\n// First, create the observable\nvar test = {};\nvar proxy = ObservableSlim.create(test, true, function(changes) {\n\tconsole.log(JSON.stringify(changes));\n});\n\n// Add a new observer function\nObservableSlim.observe(proxy, function(changes) {\n\tconsole.log(changes);\n});\n```\n\n### Pause observers\n\nIf you wish to pause the execution of observer functions, you may do so as follows:\n```javascript\nObservableSlim.pause(proxy);\n```\n\n### Resume observers\n\nWhile an observable is paused, no observer functions will be invoked when the target object is modified.\n\nTo resume the execution of observer functions:\n\n```javascript\nObservableSlim.resume(proxy);\n```\n\n### Pause changes\n\nIf you wish to pause changes to the target data without pausing the execution of the observer functions, you may do so as follows:\n```javascript\nObservableSlim.pauseChanges(proxy);\n```\n\n### Resume changes\n\nWhile an observable has changes paused, all observer functions will be invoked, but the target object will not be modified.\n\nTo resume changes:\n\n```javascript\nObservableSlim.resumeChanges(proxy);\n```\n\n### Remove an observable\n\nWhen you no longer need to use an observable or monitor the object that it targets, you may remove the observable as follows:\n\n```javascript\nObservableSlim.remove(proxy);\n```\n\n## Special features\n\n### Proxy check\n\nWhen using ObservableSlim, you can quickly determine whether or not an object is a proxy by checking the `__isProxy` property:\n\n```javascript\nvar test = {\"hello\":\"world\"};\nvar proxy = ObservableSlim.create(test, true, function(changes) {\n\tconsole.log(JSON.stringify(changes));\n});\n\nconsole.log(proxy.__isProxy); // returns true\nconsole.log(test.__isProxy); // undefined property\n```\n\n### Look up the original proxied target object\n\nObservableSlim allows you to easily fetch a reference to the original object behind a given proxy using the `__getTarget` property:\n\n```javascript\n\nvar test = {\"hello\":{\"foo\":{\"bar\":\"world\"}}};\nvar proxy = ObservableSlim.create(test, true, function(changes) {});\n\nconsole.log(proxy.__getTarget === test); // returns true\n\n```\n\n### Look up a parent object from a child object\n\nObservableSlim allows you to traverse up from a child object and access the parent object:\n\n```javascript\n\nvar test = {\"hello\":{\"foo\":{\"bar\":\"world\"}}};\nvar proxy = ObservableSlim.create(test, true, function(changes) {\n\tconsole.log(JSON.stringify(changes));\n});\n\nfunction traverseUp(childObj) {\n\tconsole.log(JSON.stringify(childObj.__getParent())); // prints out test.hello: {\"foo\":{\"bar\":\"world\"}}\n\tconsole.log(childObj.__getParent(2)); // attempts to traverse up two levels, returns undefined because test.hello does not have a parent object\n};\n\ntraverseUp(proxy.hello.foo);\n```\n\n\n## Requirements\n\nFor full functionality, Observable Slim requires [ES6 Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy).\n\nAs of August 2017, ES6 Proxy is supported by Chrome 49+, Edge 12+, Firefox 18+, Opera 36+ and Safari 10+. Internet Explorer does not support ES6 Proxy.\n\n### ES5 Proxy polyfill (IE11 support) ###\n\nObservableSlim now offers limited support for ES5 browsers or browsers without native Proxy (most motably IE11) through the integration of a forked version of the [Google Chrome Proxy polyfill](https://github.com/GoogleChrome/proxy-polyfill).\n\nThe forked version of the Proxy polyfill (contained within this repo) differs from the original Polyfill by adding support for the array mutation methods: `push`, `pop`, `shift`, `unshift`, `splice`, `sort`, and `reverse`.\n\n#### Limitations ####\n\nBecause the Proxy polyfill does not (and will never) fully emulate native ES6 Proxy, there are certain use cases that will not work when using Observable Slim with the Proxy polyfill:\n\n1. Object properties must be known at creation time. New properties cannot be added later.\n2. Modifications to `.length` cannot be observed.\n3. Array re-sizing via a `.length` modification cannot be observed.\n4. Property deletions (e.g., `delete proxy.property;`) cannot be observed.\n\nArray mutations **can** be observed through the use of the array mutation methods listed above.\n\n## Contributing\n\nContributions are most welcome! Please be sure to run `gulp test` and `gulp lint` against your code before submitting a pull request.\n","readmeFilename":"README.md"}