xhr-rx-bare

Bare bones Rx-based XHR.

Usage no npm install needed!

<script type="module">
  import xhrRxBare from 'https://cdn.skypack.dev/xhr-rx-bare';
</script>

README

xhr-rx-bare

Copied and generalized from here: http://www.sitepoint.com/functional-reactive-programming-rxjs/

Bare bones Rx-based XHR.

example

var xhrRx = require('xhr-rx-bare')

xhrRx('https://baconipsum.com/api/?type=all-meat&paras=2&start-with-lorem=1')
  .subscribe(
    function (response) {
      document.querySelector('#app').innerHTML = JSON.parse(response)[0]
    },
    function (err) {
      console.log(err)
    })

install

npm install --save xhr-rx-bare

license

MIT