Skip to content

Commit

Permalink
make dependencies compatible with both angular and meteor
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Mar 16, 2018
1 parent a67078c commit bcdc720
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 40 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ let observable = new MongoObservable.Collection(collection);
collection.attachSchema(...); // with SimpleSchema package
```

## Usage in Angular 2
## Usage in Angular

Angular 2 has tight integration with RxJS since Angular 2 is desinged to support reactive UI updates.
Angular has tight integration with RxJS since Angular is desinged to support reactive UI updates.
One of the realizations of this integration is `AsyncPipe`, which is supposed to be used with RxJS observables.

In order to subscribe on the Mongo cursor observable's updates and iterate through the returned list of docs in Angular 2, one can use `AsyncPipe` in an Angular 2 component as follows:
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

Expand All @@ -74,7 +74,7 @@ class Tasks {
### Zone operator

As you can see above we called `zone` method of the cursor observable. This is a special
Zone operator that is implemeted by `meteor-rxjs` for the Angular 2 users' convenience.
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 Down
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.js.map

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

3 changes: 0 additions & 3 deletions dist/bundles/index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
(factory((global.meteor = global.meteor || {}, global.meteor.rxjs = {}),global.mongo,global.Observable,global.Subject,global.meteor,global.tracker,global.Subscriber));
}(this, (function (exports,mongo,Observable,Subject,meteor,tracker,Subscriber) { 'use strict';

'use strict';
var subscribeEvents = ['onReady', 'onError', 'onStop'];
function isMeteorCallbacks(callbacks) {
return _.isFunction(callbacks) || isCallbacksObject(callbacks);
Expand Down Expand Up @@ -752,8 +751,6 @@ var ZoneSubscriber = /** @class */ (function (_super) {
}(Subscriber.Subscriber));
Observable.Observable.prototype.zone = zoneOperator;

/// <reference path="../node_modules/zone.js/dist/zone.js.d.ts" />

exports.MeteorObservable = MeteorObservable;
exports.ObservableCursor = ObservableCursor;
exports.zoneOperator = zoneOperator;
Expand Down
1 change: 0 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference path="../node_modules/zone.js/dist/zone.js.d.ts" />
export * from './ObservableCollection';
export * from './MeteorObservable';
export * from './ObservableCursor';
Expand Down
1 change: 0 additions & 1 deletion dist/index.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/index.js.map

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

1 change: 0 additions & 1 deletion dist/utils.js

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

Loading

0 comments on commit bcdc720

Please sign in to comment.