I am aware of there is a function ko.utils.unwrapObserable()
but it doesn't seem to unwrap an observable that is mapped by the ko.mapping.fromJS()
at all:
console.log(listing);
listing = ko.utils.unwrapObservable(listing);
console.log(listing);
And I get the following output:
Object { __ko_mapping__={...}, title=c(), remote_id=c(), more...}
Object { __ko_mapping__={...}, title=c(), remote_id=c(), more...}
Reason I am asking for this is related to another question, basically listing is an instance of a class, which has methods reference its variables, the problem is after listing is mapped to an observable and the class methods will fail because the variables become methods.
My question is, is there a function for me to undo the mapping?