3.0.0 • Published 3 years ago

universal-rxjs-ajax v3.0.0

Weekly downloads
587
License
MIT
Repository
github
Last release
3 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

3 years ago

3.0.0

3 years ago

3.0.0-beta.1

4 years ago

3.0.0-beta.0

4 years ago

3.0.0-beta.3

4 years ago

3.0.0-beta.2

4 years ago

3.0.0-beta.4

4 years ago

2.0.4

5 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago