JSFiddle - React, Tailwind, and code Playground
by danialfarid
JavaScript
resource = function(config) {
return function() {
this.save = function() {
if (this._isNew) {
return this.post();
} else {
return this.put();
}
}
this.post = function() {
if (this.
}
}
}
var C = resource('aa');
var c = new C();
console.log(c);
console.log(c instanceof C);
var D = resource('ff');
var d = new D();
console.log(d);
console.log(d instanceof D);