flapjax

Monadic AJAX module

Usage no npm install needed!

<script type="module">
  import flapjax from 'https://cdn.skypack.dev/flapjax';
</script>

README

Flapjax

Monadic Ajax module

Usage

// type Config = {
//   url : String,
//   method : String,
//   body [OPTIONAL] : String,
//   responseType [OPTIONAL] : String
//   timeout [OPTIONAL] : Number,
//   withCredentials [OPTIONAL] : Bool
//   headers [OPTIONAL] : { String : String }  
//   events [OPTIONAL] : { 
//     loadstart : (Event) -> (),
//     progress : (Event) -> (),
//     abort : (Event) -> (),
//     error : (Event) -> (),
//     load : (Event) -> (),
//     timeout : (Event) -> (),
//     loadend : (Event) -> (),
//   }
// }
//
// flapjax :: Config -> Future XHR
const future = flapjax(config);

To use the future, please review the Fluture API