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.exportProperty calls 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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With