3.0.0 • Published 2 years ago

universal-rxjs-ajax v3.0.0

Weekly downloads
587
License
MIT
Repository
github
Last release
2 years ago

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')

interface Repo {
  name: string
}

// config as accepted by Observable.ajax()
const config = {
  url: 'https://api.github.com/orgs/Reactive-Extensions/repos',
  method: 'GET', // and so on...
}

request<Repo[]>(config)
  .pipe(map(({response}) => response.map((repo) => repo.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

3.0.0-beta.5

2 years ago

3.0.0

2 years ago

3.0.0-beta.1

3 years ago

3.0.0-beta.0

3 years ago

3.0.0-beta.3

3 years ago

3.0.0-beta.2

3 years ago

3.0.0-beta.4

3 years ago

2.0.4

4 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago