Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to rxjs 6 and axios 0.18 #5

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ cache:
directories:
- "node_modules"
before_script:
- "npm install --no-save axios@0.17 rxjs"
- "npm install --no-save axios@0.18 rxjs"
script:
- "npm test -- -w=2"
after_success:
Expand Down
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -6,6 +6,10 @@

Rxios makes the awesome [axios](https://github.com/axios/axios) library reactive, so that it's responses are returned as [RxJS](https://github.com/ReactiveX/rxjs) observables.

### RxJS 6

Note that this version is build against [RxJS 6](https://github.com/ReactiveX/rxjs#rxjs-6) and your project may require migration from RxJS 5.x to RxJS 6.x.

### Observables? Why?

Regular promises are cool, especially for HTTP requests in async/await functions.
Expand Down Expand Up @@ -95,11 +99,11 @@ All Rxios methods always return an Observable, to which we can apply advanced Rx
For example, we could make two simultaneous requests and merge their responses as they come, without needing to wait for both to be completed.

```javascript
import { Observable } from 'rxjs/Rx';
import { Observable, merge } from 'rxjs';
import { Rxios } from 'rxios';
const http = new Rxios();

const firstReq = http.get('/posts/1');
const secondReq = http.get('/posts/2');
firstReq.merge(secondReq).subscribe(...);
merge(firstReq, secondReq).subscribe(...);
```