Miss any of our Open RFC calls?Watch the recordings here! »

universal-rxjs-ajax

2.0.4 • Public • Published

universal-rxjs-ajax

Build Status npm version Join the chat at https://gitter.im/mcmunder/universal-rxjs-ajax

All credit goes to jayphelps. Copied from his suggestion made here.

universal-rxjs-ajax makes Observable.ajax available in Node.js by throwing in xhr2 when necessary.

Usage

const {map} = require('rxjs/operators')
const {request} = require('universal-rxjs-ajax')
 
// settings as accepted by Observable.ajax()
const settings = {
  url: 'https://api.github.com/orgs/Reactive-Extensions/repos',
  method: 'GET' // and so on...
}
 
request(settings)
  .pipe(map(({response}) => response.map(r => r.name)))
  .subscribe(repoNames => console.log(repoNames))

Try it yourself

https://runkit.com/mcmunder/universal-rxjs-ajax-playground

Copyright and license

Copyright 2018, Matthias Munder.
Licensed under the MIT license.

js-standard-style

Install

npm i universal-rxjs-ajax

DownloadsWeekly Downloads

499

Version

2.0.4

License

MIT

Unpacked Size

8.85 kB

Total Files

13

Last publish

Collaborators

  • avatar