JSFiddle - React, Tailwind, and code Playground
by skram
HTML
<div id="test"></div>
JavaScript
$(function() {
$.fn.bindTo = function(o1) {
var _that = this;
Object.defineProperty(o1, 'myFx', {
value: function() { return $(_that); },
writable: true,
enumerable: false,
configurable: true
});
}
$.retrieve = function(obj) {
return obj.myFx();
}
var obj = {
prop: 'prop'
};
$('#test').bindTo(obj);
$($.retrieve(obj)).html('Test');
for (i in obj) {
alert(obj[i]);
}
});