JSFiddle - React, Tailwind, and code Playground
by Chase Wilson
JavaScript
var Something = function(config,callback){
this.initialize && this.initialize(config,callback);
};
Something.prototype = {
initialize: function(config, callback){
this.setOptions(config);
this.asyncCall(callback);
}
,asyncCall: function(callback){
new Request({
onSuccess: function(text){
callback(false,text)
})
,onError: function(message){
callback({message: message});
}
})
}
};
// Do Something
var somethingDid = new Something(function(err, response){
if(err) throw new Error(err.message);
// other wise do shit.
});