Skip to content

Commit

Permalink
Fix imports for rxjs 6 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed May 6, 2018
1 parent cd9374f commit d4ea0ec
Show file tree
Hide file tree
Showing 29 changed files with 3,129 additions and 3,144 deletions.
364 changes: 182 additions & 182 deletions CHANGELOG.md

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Since this cursor observable is of RxJS’s type, every other methods and operat

```ts

import {Observable} from 'rxjs/Observable';
import {Observable} from 'rxjs';

import 'rxjs/add/operator/debounce';
import {debounce, map} from 'rxjs/operators';

Tasks.find({checked: false})
.debounce(() => Observable.interval(50))
.map(tasks => tasks.length)
.pipe(debounce(() => Observable.interval(50)))
.pipe(map(tasks => tasks.length))
.subscribe(todoCount => console.log(todoCount));

```
Expand All @@ -58,6 +58,7 @@ One of the realizations of this integration is `AsyncPipe`, which is supposed to
In order to subscribe on the Mongo cursor observable's updates and iterate through the returned list of docs in Angular, one can use `AsyncPipe` in an Angular component as follows:

```ts
import { MongoObservable, zoneOperator } from 'rxjs';

const Tasks = new MongoObservable.Collection<Task>('tasks');

Expand All @@ -66,14 +67,14 @@ const Tasks = new MongoObservable.Collection<Task>('tasks');
template: `<ul><li *ngFor="let task of tasks | async"></li></ul>`
})
class Tasks {
tasks = Tasks.find().zone();
tasks = Tasks.find().pipe(zoneOperator());
}

````

### Zone operator

As you can see above we called `zone` method of the cursor observable. This is a special
As you can see above we called `zoneOperator` operator of the cursor observable. This is a special
Zone operator that is implemeted by `meteor-rxjs` for the Angular users' convenience.
This operator runs ngZone each time when new data arrives to the Mongo cursor observable,
thus we force UI updates at the right time using it.
Expand All @@ -85,7 +86,8 @@ In this case we are using Zone operator as well:
class List {
tasks = Tasks.find()
.debounce(() => Observable.interval(50))
.pipe(zoneOperator())
.pipe(debounce(() => Observable.interval(50)))
.zone();
}
Expand Down
2 changes: 1 addition & 1 deletion dist/MeteorObservable.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
/**
* This is a class with static methods that wrap Meteor's API and return RxJS
* Observables. The methods' signatures are the same as Meteor's, with the ]
Expand Down
2 changes: 1 addition & 1 deletion dist/MeteorObservable.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/MeteorObservable.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ObservableCollection.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
import { ObservableCursor } from './ObservableCursor';
import Selector = Mongo.Selector;
import ObjectID = Mongo.ObjectID;
Expand Down
2 changes: 1 addition & 1 deletion dist/ObservableCollection.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ObservableCollection.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ObservableCursor.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';
export declare class ObservableCursor<T> extends Observable<T[]> {
private _zone;
private _data;
Expand Down
3 changes: 1 addition & 2 deletions dist/ObservableCursor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d4ea0ec

Please sign in to comment.