UNPKG

@djforth/ajax-es6-fp

Version:

Promised Based Ajax Helper - With RoR in mind

1 lines 581 B
(function(global,factory){if("function"==typeof define&&define.amd)define(["module","exports"],factory);else if("undefined"!=typeof exports)factory(module,exports);else{var mod={exports:{}};factory(mod,mod.exports),global.ready_state=mod.exports}})(this,function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(suc,err,status){return function(xhr){switch(status(xhr.status,xhr.readyState)){case-1:err(xhr.responseText,xhr.statusText,xhr.status);break;case 1:suc(xhr.responseText);}}},module.exports=exports["default"]});