I am reading knockout.js library source codes and i saw such as function calls
ko.exportProperty(this, 'subscribe', this.subscribe);
ko.exportProperty(this, 'extend', this.extend);
ko.exportProperty(this, 'getSubscriptionsCount', this.getSubscriptionsCount);
You can check source code in here
and exportProperty definition is
ko.exportProperty = function(owner, publicName, object) {
owner[publicName] = object;
};
Source code is here.
I am trying to understand what it does. But what i understand exportProperty usage does not change or break anything on object when i look at usages at upside.
Can you explain what for exportProperty function called ?
The minified file is created via Google’s Closure Compiler, which can do some pretty aggressive minification. The
ko.exportPropertycalls ensure that the property will be included in the minimized output with the its full name with the same name. The calls that are exported can be considered the “public API”.