Skip to content

Instantly share code, notes, and snippets.

@frpaulas
Created May 30, 2017 13:36
Show Gist options
  • Save frpaulas/4fea9806a7e173d312d6616e66c62614 to your computer and use it in GitHub Desktop.
Save frpaulas/4fea9806a7e173d312d6616e66c62614 to your computer and use it in GitHub Desktop.
var firstReading = Observable()
// mp1 has two Objects of
// {title: title, chap: chap, vsFrom: vsFrom, vsTo: vsTo, vss: vss}
mp1.forEach(function(el) {
var obj = getReading(el.read);
obj.type = el.style;
firstReading.add(obj);
})
console.log(firstReading.length); // 2
Object.keys(firstReading.first()).forEach(function(x) {console.log(x)})
// _origin, _subscribers, _isProxy, _values, _failed, _subscriptionWatchers
// I expected to see title, chap, vsFrom, vsTo, vss, type
Object.keys(firstReading.value).forEach(function(x) {console.log(x)})
// title, chap, vsFrom, vsTo, vss, type
// I expected to see an Array of length 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment