object-observer
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -13,3 +13,3 @@ (() => { | ||
target.slice() : | ||
Object.assign(new target.constructor(), target); | ||
Object.assign({}, target); | ||
} | ||
@@ -16,0 +16,0 @@ |
@@ -1,1 +0,1 @@ | ||
(()=>{"use strict";const e=this||window,t=new Map,o=new Map,r=new Map,n=["Date","Blob","Number","String","Boolean","Error","SyntaxError","TypeError","URIError","Function","Promise","RegExp"];function l(e){return n.indexOf(e.constructor.name)>=0}function i(e,n){let l,i=o.get(e),f=r.get(i.root);return l="pop"===n?function(){let r,l,a,c;return r=e.length-1,l=Reflect.apply(e[n],e,arguments),(a=t.get(l))&&o.get(a).revoke(),c=[new y(i.path.concat(r),a||l)],f.notify(c),a||l}:"push"===n?function(){let t,o,r,l=[];t=Array.from(arguments),r=e.length;for(let e,o=0,n=t.length;o<n;o++)(e=t[o])&&"object"==typeof e&&(t[o]=new c(e,r+o,i).proxy),l.push(new p(i.path.concat(r+o),e));return o=Reflect.apply(e[n],e,t),f.notify(l),o}:"shift"===n?function(){let r,l,a;r=Reflect.apply(e[n],e,arguments),(a=t.get(r))&&o.get(a).revoke();for(let r,n,l=0,i=e.length;l<i;l++)(r=e[l])&&"object"==typeof r&&((n=o.get(t.get(r)))?n.ownKey=l:console.error("unexpectedly failed to resolve proxy -> target -> observed"));return l=[new y(i.path.concat(0),a||r)],f.notify(l),a||r}:"unshift"===n?function(){let r,l,a,s=[];(r=Array.from(arguments)).forEach(function(e,t){e&&"object"==typeof e&&(r[t]=new c(e,t,i).proxy)}),l=Reflect.apply(e[n],e,r);for(let r,n=0,l=e.length;n<l;n++)(r=e[n])&&"object"==typeof r&&((a=o.get(t.get(r)))?a.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));for(let t=0,o=r.length;t<o;t++)s.push(new p(i.path.concat(t),e[t]));return f.notify(s),l}:"reverse"===n?function(){let r,l;Reflect.apply(e[n],e,arguments);for(let r,n=0,i=e.length;n<i;n++)(r=e[n])&&"object"==typeof r&&((l=o.get(t.get(r)))?l.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));return r=[new function(){Object.defineProperties(this,{type:{value:"reverse"}})}],f.notify(r),this}:"sort"===n?function(){let r,l;Reflect.apply(e[n],e,arguments);for(let r,n=0,i=e.length;n<i;n++)(r=e[n])&&"object"==typeof r&&((l=o.get(t.get(r)))?l.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));return r=[new function(){Object.defineProperties(this,{type:{value:"shuffle"}})}],f.notify(r),this}:"fill"===n?function(){let r,l,a,s=[],y=arguments.length,h=e.length;r=y<2?0:arguments[1]<0?h+arguments[1]:arguments[1],l=y<3?h:arguments[2]<0?h+arguments[2]:arguments[2],a=e.slice(),Reflect.apply(e[n],e,arguments);for(let n,f,y=r;y<l;y++)(n=e[y])&&"object"==typeof n&&(e[y]=new c(n,y,i).proxy),a.hasOwnProperty(y)?((f=t.get(a[y]))&&o.get(f).revoke(),s.push(new u(i.path.concat(y),e[y],f||a[y]))):s.push(new p(i.path.concat(y),e[y]));return f.notify(s),this}:"splice"===n?function(){let r,l,a,s,h,b,v,g,w=[],d=e.length;v=(r=Array.from(arguments)).length;for(let e,t=0;t<v;t++)e=r[t],t>1&&e&&"object"==typeof e&&(r[t]=new c(e,t,i).proxy);s=0===v?0:r[0]<0?d+r[0]:r[0],h=v<2?d-s:r[1],b=Math.max(v-2,0),l=Reflect.apply(e[n],e,r);for(let r,n=0;n<d;n++)(r=e[n])&&"object"==typeof r&&((a=o.get(t.get(r)))?a.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));for(let e,r,n=0,i=l.length;n<i;n++)e=l[n],(r=t.get(e))&&(o.get(r).revoke(),l[n]=r);for(g=0;g<h;g++)g<b?w.push(new u(i.path.concat(s+g),e[s+g],l[g])):w.push(new y(i.path.concat(s+g),l[g]));for(;g<b;g++)w.push(new p(i.path.concat(s+g),e[s+g]));return f.notify(w),l}:Reflect.get(e,n)}function f(e,n,i){let f,a,s=e.hasOwnProperty(n),y=e[n],h=o.get(e),b=r.get(h.root);if((f=i&&"object"==typeof i&&!l(i)?Reflect.set(e,n,new c(i,n,h).proxy):Reflect.set(e,n,i))&&((a=t.get(y))&&o.get(a).revoke(),b.hasListeners)){let e=h.path.concat(n),t=[s?new u(e,i,a||y):new p(e,i)];h.preventCallbacks||b.notify(t)}return f}function a(e,n){let l,i,f=e[n],a=o.get(e),c=r.get(a.root);if((l=Reflect.deleteProperty(e,n))&&((i=t.get(f))&&o.get(i).revoke(),c.hasListeners)){let e=[new y(a.path.concat(n),i||f)];a.preventCallbacks||c.notify(e)}return l}function c(e,r,n){let s,p,u;if(!e||"object"!=typeof e)throw new Error("Observed MUST be created from a non null object origin");if(n&&(void 0===r||null===r))throw new Error("any non-root (parent-less) Observed MUST have an own path; now parent is "+n+"; key is "+r);if(n&&!(n instanceof c))throw new Error("parent, when supplied, MUST be an instance of Observed");var y;y=e,s=Array.isArray(y)?y.slice():Object.assign(new y.constructor,y),Array.isArray(s)?(!function(e,t){for(let o,r=0,n=e.length;r<n;r++)(o=e[r])&&"object"==typeof o&&!l(o)&&(e[r]=new c(o,r,t).proxy)}(s,this),p=Proxy.revocable(s,{set:f,get:i,deleteProperty:a})):(!function(e,t){let o=Object.keys(e);for(let r,n,i=0,f=o.length;i<f;i++)(n=e[r=o[i]])&&"object"==typeof n&&!l(n)&&(e[r]=new c(n,r,t).proxy)}(s,this),p=Proxy.revocable(s,{set:f,deleteProperty:a})),u=p.proxy,o.set(s,this),t.set(u,s),Object.defineProperties(this,{revokable:{value:p},proxy:{value:u},parent:{value:n},ownKey:{value:r,writable:!0}})}function s(e){let t=!1,o=[];Object.defineProperties(e.proxy,{observe:{value:function(e){if(t)throw new TypeError("revoked Observable MAY NOT be observed anymore");if("function"!=typeof e)throw new Error("observer (callback) parameter MUST be a function");o.indexOf(e)<0?o.push(e):console.info("observer (callback) may be bound to an observable only once")}},unobserve:{value:function(){if(t)throw new TypeError("revoked Observable MAY NOT be unobserved anymore");if(arguments.length)for(let e,t=0,r=arguments.length;t<r;t++)(e=o.indexOf(arguments[t]))>=0&&o.splice(e,1);else o.splice(0,o.length)}},revoke:{value:function(){t?console.log("revoking of Observable effective only once"):(t=!0,e.revoke())}}}),Object.defineProperties(this,{hasListeners:{value:function(){return o.length>0}},notify:{value:function(e){for(let t,r=0,n=o.length;r<n;r++){t=o[r];try{t(e)}catch(e){console.error("one/some of the observing callbacks failed with ",e)}}}}})}function p(e,t){Object.defineProperties(this,{type:{value:"insert"},path:{value:e},value:{value:t}})}function u(e,t,o){Object.defineProperties(this,{type:{value:"update"},path:{value:e},value:{value:t},oldValue:{value:o}})}function y(e,t){Object.defineProperties(this,{type:{value:"delete"},path:{value:e},oldValue:{value:t}})}Object.defineProperty(c.prototype,"root",{get:function(){let e=this;for(;e.parent;)e=e.parent;return e}}),Object.defineProperty(c.prototype,"path",{get:function(){let e=[],t=this;for(;void 0!==t.ownKey;)e.unshift(t.ownKey),t=t.parent;return e}}),Object.defineProperty(c.prototype,"revoke",{value:function(){let e=t.get(this.proxy),r=Object.keys(e);this.revokable.revoke();for(let n,l,i=0,f=r.length;i<f;i++)n=r[i],(l=t.get(e[n]))&&(e[n]=o.get(l).revoke());return t.delete(this.proxy),o.delete(e),e}}),Object.defineProperty(s,"from",{value:function(e){if(!e||"object"!=typeof e)throw new Error("observable MAY ONLY be created from non-null object only");if("observe"in e||"unobserve"in e||"revoke"in e)throw new Error('target object MUST NOT have nor own neither inherited properties from the following list: "observe", "unobserve", "revoke"');if(l(e))throw new Error(e+" found to be one of non-observable object types: "+n);let t=new c(e),o=new s(t);return r.set(t,o),t.proxy}}),Object.defineProperty(e,"Observable",{value:s})})(); | ||
(()=>{"use strict";const e=this||window,t=new Map,o=new Map,r=new Map,n=["Date","Blob","Number","String","Boolean","Error","SyntaxError","TypeError","URIError","Function","Promise","RegExp"];function l(e){return n.indexOf(e.constructor.name)>=0}function i(e,n){let l,i=o.get(e),f=r.get(i.root);return l="pop"===n?function(){let r,l,a,c;return r=e.length-1,l=Reflect.apply(e[n],e,arguments),(a=t.get(l))&&o.get(a).revoke(),c=[new y(i.path.concat(r),a||l)],f.notify(c),a||l}:"push"===n?function(){let t,o,r,l=[];t=Array.from(arguments),r=e.length;for(let e,o=0,n=t.length;o<n;o++)(e=t[o])&&"object"==typeof e&&(t[o]=new c(e,r+o,i).proxy),l.push(new s(i.path.concat(r+o),e));return o=Reflect.apply(e[n],e,t),f.notify(l),o}:"shift"===n?function(){let r,l,a;r=Reflect.apply(e[n],e,arguments),(a=t.get(r))&&o.get(a).revoke();for(let r,n,l=0,i=e.length;l<i;l++)(r=e[l])&&"object"==typeof r&&((n=o.get(t.get(r)))?n.ownKey=l:console.error("unexpectedly failed to resolve proxy -> target -> observed"));return l=[new y(i.path.concat(0),a||r)],f.notify(l),a||r}:"unshift"===n?function(){let r,l,a,p=[];(r=Array.from(arguments)).forEach(function(e,t){e&&"object"==typeof e&&(r[t]=new c(e,t,i).proxy)}),l=Reflect.apply(e[n],e,r);for(let r,n=0,l=e.length;n<l;n++)(r=e[n])&&"object"==typeof r&&((a=o.get(t.get(r)))?a.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));for(let t=0,o=r.length;t<o;t++)p.push(new s(i.path.concat(t),e[t]));return f.notify(p),l}:"reverse"===n?function(){let r,l;Reflect.apply(e[n],e,arguments);for(let r,n=0,i=e.length;n<i;n++)(r=e[n])&&"object"==typeof r&&((l=o.get(t.get(r)))?l.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));return r=[new function(){Object.defineProperties(this,{type:{value:"reverse"}})}],f.notify(r),this}:"sort"===n?function(){let r,l;Reflect.apply(e[n],e,arguments);for(let r,n=0,i=e.length;n<i;n++)(r=e[n])&&"object"==typeof r&&((l=o.get(t.get(r)))?l.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));return r=[new function(){Object.defineProperties(this,{type:{value:"shuffle"}})}],f.notify(r),this}:"fill"===n?function(){let r,l,a,p=[],y=arguments.length,h=e.length;r=y<2?0:arguments[1]<0?h+arguments[1]:arguments[1],l=y<3?h:arguments[2]<0?h+arguments[2]:arguments[2],a=e.slice(),Reflect.apply(e[n],e,arguments);for(let n,f,y=r;y<l;y++)(n=e[y])&&"object"==typeof n&&(e[y]=new c(n,y,i).proxy),a.hasOwnProperty(y)?((f=t.get(a[y]))&&o.get(f).revoke(),p.push(new u(i.path.concat(y),e[y],f||a[y]))):p.push(new s(i.path.concat(y),e[y]));return f.notify(p),this}:"splice"===n?function(){let r,l,a,p,h,b,v,g,w=[],d=e.length;v=(r=Array.from(arguments)).length;for(let e,t=0;t<v;t++)e=r[t],t>1&&e&&"object"==typeof e&&(r[t]=new c(e,t,i).proxy);p=0===v?0:r[0]<0?d+r[0]:r[0],h=v<2?d-p:r[1],b=Math.max(v-2,0),l=Reflect.apply(e[n],e,r);for(let r,n=0;n<d;n++)(r=e[n])&&"object"==typeof r&&((a=o.get(t.get(r)))?a.ownKey=n:console.error("failed to resolve proxy -> target -> observed"));for(let e,r,n=0,i=l.length;n<i;n++)e=l[n],(r=t.get(e))&&(o.get(r).revoke(),l[n]=r);for(g=0;g<h;g++)g<b?w.push(new u(i.path.concat(p+g),e[p+g],l[g])):w.push(new y(i.path.concat(p+g),l[g]));for(;g<b;g++)w.push(new s(i.path.concat(p+g),e[p+g]));return f.notify(w),l}:Reflect.get(e,n)}function f(e,n,i){let f,a,p=e.hasOwnProperty(n),y=e[n],h=o.get(e),b=r.get(h.root);if((f=i&&"object"==typeof i&&!l(i)?Reflect.set(e,n,new c(i,n,h).proxy):Reflect.set(e,n,i))&&((a=t.get(y))&&o.get(a).revoke(),b.hasListeners)){let e=h.path.concat(n),t=[p?new u(e,i,a||y):new s(e,i)];h.preventCallbacks||b.notify(t)}return f}function a(e,n){let l,i,f=e[n],a=o.get(e),c=r.get(a.root);if((l=Reflect.deleteProperty(e,n))&&((i=t.get(f))&&o.get(i).revoke(),c.hasListeners)){let e=[new y(a.path.concat(n),i||f)];a.preventCallbacks||c.notify(e)}return l}function c(e,r,n){let p,s,u;if(!e||"object"!=typeof e)throw new Error("Observed MUST be created from a non null object origin");if(n&&(void 0===r||null===r))throw new Error("any non-root (parent-less) Observed MUST have an own path; now parent is "+n+"; key is "+r);if(n&&!(n instanceof c))throw new Error("parent, when supplied, MUST be an instance of Observed");var y;y=e,p=Array.isArray(y)?y.slice():Object.assign({},y),Array.isArray(p)?(!function(e,t){for(let o,r=0,n=e.length;r<n;r++)(o=e[r])&&"object"==typeof o&&!l(o)&&(e[r]=new c(o,r,t).proxy)}(p,this),s=Proxy.revocable(p,{set:f,get:i,deleteProperty:a})):(!function(e,t){let o=Object.keys(e);for(let r,n,i=0,f=o.length;i<f;i++)(n=e[r=o[i]])&&"object"==typeof n&&!l(n)&&(e[r]=new c(n,r,t).proxy)}(p,this),s=Proxy.revocable(p,{set:f,deleteProperty:a})),u=s.proxy,o.set(p,this),t.set(u,p),Object.defineProperties(this,{revokable:{value:s},proxy:{value:u},parent:{value:n},ownKey:{value:r,writable:!0}})}function p(e){let t=!1,o=[];Object.defineProperties(e.proxy,{observe:{value:function(e){if(t)throw new TypeError("revoked Observable MAY NOT be observed anymore");if("function"!=typeof e)throw new Error("observer (callback) parameter MUST be a function");o.indexOf(e)<0?o.push(e):console.info("observer (callback) may be bound to an observable only once")}},unobserve:{value:function(){if(t)throw new TypeError("revoked Observable MAY NOT be unobserved anymore");if(arguments.length)for(let e,t=0,r=arguments.length;t<r;t++)(e=o.indexOf(arguments[t]))>=0&&o.splice(e,1);else o.splice(0,o.length)}},revoke:{value:function(){t?console.log("revoking of Observable effective only once"):(t=!0,e.revoke())}}}),Object.defineProperties(this,{hasListeners:{value:function(){return o.length>0}},notify:{value:function(e){for(let t,r=0,n=o.length;r<n;r++){t=o[r];try{t(e)}catch(e){console.error("one/some of the observing callbacks failed with ",e)}}}}})}function s(e,t){Object.defineProperties(this,{type:{value:"insert"},path:{value:e},value:{value:t}})}function u(e,t,o){Object.defineProperties(this,{type:{value:"update"},path:{value:e},value:{value:t},oldValue:{value:o}})}function y(e,t){Object.defineProperties(this,{type:{value:"delete"},path:{value:e},oldValue:{value:t}})}Object.defineProperty(c.prototype,"root",{get:function(){let e=this;for(;e.parent;)e=e.parent;return e}}),Object.defineProperty(c.prototype,"path",{get:function(){let e=[],t=this;for(;void 0!==t.ownKey;)e.unshift(t.ownKey),t=t.parent;return e}}),Object.defineProperty(c.prototype,"revoke",{value:function(){let e=t.get(this.proxy),r=Object.keys(e);this.revokable.revoke();for(let n,l,i=0,f=r.length;i<f;i++)n=r[i],(l=t.get(e[n]))&&(e[n]=o.get(l).revoke());return t.delete(this.proxy),o.delete(e),e}}),Object.defineProperty(p,"from",{value:function(e){if(!e||"object"!=typeof e)throw new Error("observable MAY ONLY be created from non-null object only");if("observe"in e||"unobserve"in e||"revoke"in e)throw new Error('target object MUST NOT have nor own neither inherited properties from the following list: "observe", "unobserve", "revoke"');if(l(e))throw new Error(e+" found to be one of non-observable object types: "+n);let t=new c(e),o=new p(t);return r.set(t,o),t.proxy}}),Object.defineProperty(e,"Observable",{value:p})})(); |
{ | ||
"name": "object-observer", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"homepage": "https://github.com/gullerya/object-observer-js/README.md", | ||
@@ -5,0 +5,0 @@ "author": { |
[![npm version](https://badge.fury.io/js/object-observer.svg)](https://badge.fury.io/js/object-observer) | ||
[![Build Status](https://travis-ci.org/gullerya/object-observer-js.svg?branch=master)](https://travis-ci.org/gullerya/object-observer-js) | ||
[![Build Status](https://travis-ci.org/gullerya/object-observer.svg?branch=master)](https://travis-ci.org/gullerya/object-observer) | ||
# Summary | ||
`object-observer` provides an __observation of a changes performed on an object__ (array being a subtype of it), hopefully in a most clean and performant way. | ||
__`object-observer`__ provides an observation of a changes performed on an object graph (array being a subtype of it). | ||
@@ -13,13 +13,11 @@ Main aspects: | ||
- changes delivered always as an __array__, in order to have unified callback API signature supporting also bulk changes delivery in a single call back | ||
- original objects are __cloned__, thus not being affected; this adds one more step to the normal usage flow: | ||
- first, create observable clone from the specified object | ||
- second, register observers on the observable (not on the original object) | ||
- original objects are __cloned__ while turned into `Observable`s | ||
- arrays: | ||
- generic object-like mutations supported | ||
- intrinsic mutation methods supported: `pop`, `push`, `shift`, `unshift`, `reverse`, `sort`, `fill`, `splice` (see below for more info on changes delivery for these) | ||
- intrinsic `Array` mutation methods supported: `pop`, `push`, `shift`, `unshift`, `reverse`, `sort`, `fill`, `splice` | ||
- massive mutations delivered in a single callback, usually having an array of an atomic changes | ||
- enhanced intrinsic methods of `Map`, `WeakMap`, `Set`, `WeakSet` like `set`, `get`, `delete` etc are not observed (see this [issue](https://github.com/gullerya/object-observer-js/issues/1) for more details) | ||
- intrinsic mutation methods of `Map`, `WeakMap`, `Set`, `WeakSet` (`set`, `delete`) etc __are not__ observed (see this [issue](https://github.com/gullerya/object-observer/issues/1) for more details) | ||
- following host objects __are not__ observed, but left as they are (the list will be updated upon changes): `Date`, `Blob`, `Number`, `String`, `Boolean`, `Error`, `SyntaxError`, `TypeError`, `URIError`, `Function`, `Promise`, `RegExp` | ||
#### Support matrix: ![CHROME](./tools/browser_icons/chrome.png) <sub>49+</sub>, ![FIREFOX](./tools/browser_icons/firefox.png) <sub>42+</sub>, ![EDGE](./tools/browser_icons/edge.png) <sub>13+</sub> | ||
Support matrix is mainly dependent on 2 advanced language features: `Proxy` and `Reflect`. The broader their adoption - the broader the support matrix of `object-observer`. | ||
#### Support matrix: ![CHROME](./tools/browser_icons/chrome.png)<sub>49+</sub> | ![FIREFOX](./tools/browser_icons/firefox.png)<sub>42+</sub> | ![EDGE](./tools/browser_icons/edge.png) <sub>13+</sub> | ![NODE JS](./tools/browser_icons/nodejs.png) <sub>8.10.0+</sub> | ||
@@ -29,7 +27,12 @@ #### Backlog: | ||
- Consider adding support for a Symbol defined object properties. __Status__: in progress | ||
- Prepare the library to be consumed as ES module (via `import` API) | ||
#### Versions | ||
- __0.2.6__ | ||
- Fixed cloning logic to allow observability for host objects like `DOMStringMap` and alike (gave up on calling the original object's constructor) | ||
- Documentation fixes | ||
- __0.2.5__ | ||
- Fix: [issue #8](https://github.com/gullerya/object-observer-js/issues/8) - incorrect `oldValue` supplied in `update`/`delete` events when handling inner object/s sub-graph | ||
- Fix: [issue #8](https://github.com/gullerya/object-observer/issues/8) - incorrect `oldValue` supplied in `update`/`delete` events when handling inner object/s sub-graph | ||
@@ -40,3 +43,3 @@ - __0.2.4__ | ||
- __0.2.3__ | ||
- Fix: correct handling of removal/replacement of the non-observable objects (issues [this](https://github.com/gullerya/object-observer-js/issues/4) and [this](https://github.com/gullerya/object-observer-js/issues/3)) | ||
- Fix: correct handling of removal/replacement of the non-observable objects (issues [this](https://github.com/gullerya/object-observer/issues/4) and [this](https://github.com/gullerya/object-observer-js/issues/3)) | ||
@@ -62,7 +65,7 @@ - __0.2.2__ | ||
* Simple a reference (script tag) to the object-oserver.js in your HTML will load it into the __global scope__: | ||
* Simple a reference (script tag) to the `object-observer.min.js`/`object-observer.js` in your `HTML` will load it into the __global scope__: | ||
```html | ||
<script src="object-observer.js"></script> | ||
<script src="object-observer.min.js"></script> | ||
<script> | ||
var person = { name: 'Uriya', age: 8 }, | ||
let person = { name: 'Uriya', age: 8 }, | ||
observablePerson; | ||
@@ -75,7 +78,7 @@ observablePerson = Observable.from(person); | ||
```javascript | ||
var customNamespace = {}, | ||
let customNamespace = {}, | ||
person = { name: 'Nava', age: 6 }, | ||
observablePerson; | ||
fetch('object-observer.js').then(function (response) { | ||
fetch('object-observer.min.js').then(function (response) { | ||
if (response.status === 200) { | ||
@@ -96,5 +99,5 @@ response.text().then(function (code) { | ||
- __`from`__ - receives a _non-null object_ and returns __`Observable`__ interface: | ||
- __`from`__ - receives a _non-null object_ and returns its __clone__, decorated with an __`Observable`__ interface: | ||
```javascript | ||
var person = { name: 'Aya', age: '1' }, | ||
let person = { name: 'Aya', age: '1' }, | ||
observablePerson; | ||
@@ -106,2 +109,4 @@ | ||
Clone is deep, having cloned all of the object's sub-graph. Cloning performed by means of `Object.assign`, therefore only __own enumerables__ are going to be observed. | ||
##### `Observable` instance properties | ||
@@ -151,3 +156,3 @@ | ||
```javascript | ||
var order = { type: 'book', pid: 102, ammount: 5, remark: 'remove me' }, | ||
let order = { type: 'book', pid: 102, ammount: 5, remark: 'remove me' }, | ||
observableOrder; | ||
@@ -172,3 +177,3 @@ observableOrder = Observable.from(order); | ||
```javascript | ||
var a = [ 1, 2, 3, 4, 5], | ||
let a = [ 1, 2, 3, 4, 5], | ||
observableA; | ||
@@ -175,0 +180,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36109
218