diff --git a/dist/MeteorObservable.d.ts b/dist/MeteorObservable.d.ts index 474a7e4b..47bc9799 100644 --- a/dist/MeteorObservable.d.ts +++ b/dist/MeteorObservable.d.ts @@ -1,23 +1,31 @@ /// import { Observable } from 'rxjs'; /** - * A class with static methods, which wraps Meteor's API and returns - * RxJS Observable as return value for all Meteor's API. - * The method's signature is the same as Metoer's, except you don't - * need to provide callbacks, and you need to "subscribe" instead. - * The functionality that wrapped in this implementation is Meteor.call, - * Meteor.autorun and Meteor.subscribe. - * + * 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 ] + * exception that the callbacks are handled by Meteor-rxjs. Instead of + * providing callbacks, you need to subscribe to the observables that are + * returned. The methods that are wrapped in MeteorObservable are + * [Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), + * [Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun) + * and [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe). */ export declare class MeteorObservable { /** - * Method has the same notation as Meteor.call, only without the callbacks: + * Invokes a [Meteor Method](https://docs.meteor.com/api/methods.html) + * defined on the server, passing any number of arguments. This method has + * the same signature as + * [Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), only + * without the callbacks: * MeteorObservable.call(name, [...args]) * - * @param {String} name - Name of the method in the Meteor server + * + * @param {string} name - Name of the method in the Meteor server * @param {any} args - Parameters that will be forwarded to the method. * after the func call to initiate change detection. - * @returns {Observable} - RxJS Observable, which completes when the server return a response. + * @returns {Observable} - RxJS Observable, which completes when the + * server returns a response. + * * @example Example using Angular2 Component * class MyComponent { * constructor() { @@ -35,16 +43,21 @@ export declare class MeteorObservable { */ static call(name: string, ...args: any[]): Observable; /** - * Method has the same notation as Meteor.subscribe, only without the callbacks: + * When you subscribe to a collection, it tells the server to send records to + * the client. This method has the same signature as + * [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe), + * except without the callbacks again: * subscribe(name, [...args]) * - * You can use this method from any Angular2 element - such as Component, Pipe or - * Service. + * You can use this method from any Angular2 element - such as Component, + * Pipe or Service. * - * @param {String} name - Name of the publication in the Meteor server + * @param {string} name - Name of the publication in the Meteor server * @param {any} args - Parameters that will be forwarded to the publication. * after the func call to initiate change detection. - * @returns {Observable} - RxJS Observable, which completes when the subscription is ready. + * @returns {Observable} - RxJS Observable, which completes when the + * subscription is ready. + * * @example Example using Angular2 Service * class MyService { * private meteorSubscription: Observable; @@ -87,7 +100,10 @@ export declare class MeteorObservable { */ static subscribe(name: string, ...args: any[]): Observable; /** - * Method has the same notation as Meteor.autorun, only without the callback: + * Allows you to run a function every time there is a change is a reactive + * data sources. This method has the same signature as + * [Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun), + * only without the callback: * MeteorObservable.autorun() * * @returns {Observable} - RxJS Observable, which trigger the subscription callback diff --git a/dist/MeteorObservable.js b/dist/MeteorObservable.js index 488d8099..82a42cfb 100644 --- a/dist/MeteorObservable.js +++ b/dist/MeteorObservable.js @@ -5,25 +5,33 @@ function throwInvalidCallback(method) { throw new Error("Invalid " + method + " arguments:\n your last param can't be a callback function, \n please remove it and use \".subscribe\" of the Observable!"); } /** - * A class with static methods, which wraps Meteor's API and returns - * RxJS Observable as return value for all Meteor's API. - * The method's signature is the same as Metoer's, except you don't - * need to provide callbacks, and you need to "subscribe" instead. - * The functionality that wrapped in this implementation is Meteor.call, - * Meteor.autorun and Meteor.subscribe. - * + * 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 ] + * exception that the callbacks are handled by Meteor-rxjs. Instead of + * providing callbacks, you need to subscribe to the observables that are + * returned. The methods that are wrapped in MeteorObservable are + * [Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), + * [Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun) + * and [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe). */ export var MeteorObservable = (function () { function MeteorObservable() { } /** - * Method has the same notation as Meteor.call, only without the callbacks: + * Invokes a [Meteor Method](https://docs.meteor.com/api/methods.html) + * defined on the server, passing any number of arguments. This method has + * the same signature as + * [Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), only + * without the callbacks: * MeteorObservable.call(name, [...args]) * - * @param {String} name - Name of the method in the Meteor server + * + * @param {string} name - Name of the method in the Meteor server * @param {any} args - Parameters that will be forwarded to the method. * after the func call to initiate change detection. - * @returns {Observable} - RxJS Observable, which completes when the server return a response. + * @returns {Observable} - RxJS Observable, which completes when the + * server returns a response. + * * @example Example using Angular2 Component * class MyComponent { * constructor() { @@ -62,16 +70,21 @@ export var MeteorObservable = (function () { }); }; /** - * Method has the same notation as Meteor.subscribe, only without the callbacks: + * When you subscribe to a collection, it tells the server to send records to + * the client. This method has the same signature as + * [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe), + * except without the callbacks again: * subscribe(name, [...args]) * - * You can use this method from any Angular2 element - such as Component, Pipe or - * Service. + * You can use this method from any Angular2 element - such as Component, + * Pipe or Service. * - * @param {String} name - Name of the publication in the Meteor server + * @param {string} name - Name of the publication in the Meteor server * @param {any} args - Parameters that will be forwarded to the publication. * after the func call to initiate change detection. - * @returns {Observable} - RxJS Observable, which completes when the subscription is ready. + * @returns {Observable} - RxJS Observable, which completes when the + * subscription is ready. + * * @example Example using Angular2 Service * class MyService { * private meteorSubscription: Observable; @@ -151,7 +164,10 @@ export var MeteorObservable = (function () { }); }; /** - * Method has the same notation as Meteor.autorun, only without the callback: + * Allows you to run a function every time there is a change is a reactive + * data sources. This method has the same signature as + * [Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun), + * only without the callback: * MeteorObservable.autorun() * * @returns {Observable} - RxJS Observable, which trigger the subscription callback diff --git a/dist/MeteorObservable.js.map b/dist/MeteorObservable.js.map index fcd7c183..40bdd642 100644 --- a/dist/MeteorObservable.js.map +++ b/dist/MeteorObservable.js.map @@ -1 +1 @@ -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C;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACW,wBAAO,GAArB;QACE,IAAI,IAAI,GAAG,QAAQ,EAAE,CAAC;QACtB,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,OAAO,GAAG;YACZ,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,UAAC,WAAgC;gBACtD,IAAI,CAAC,GAAG,CAAC;oBACP,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAA1B,CAA0B,CAAC,CAAC;gBAC5D,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAC,QAAwD;YAChF,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzB,0BAA0B;YAC1B,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;gBACrB,OAAO,GAAG,OAAO,EAAE,CAAC;YACtB,CAAC;YACD,MAAM,CAAC;gBACL,cAAc,CAAC,SAAS,EACtB,QAAQ,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,EAAE,EAAd,CAAc,CAAC,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACH,uBAAC;AAAD,CAAC,AAnMD,IAmMC"} \ No newline at end of file diff --git a/dist/bundles/index.umd.js b/dist/bundles/index.umd.js index 1c1d6660..c4928c6a 100644 --- a/dist/bundles/index.umd.js +++ b/dist/bundles/index.umd.js @@ -474,25 +474,33 @@ function throwInvalidCallback(method) { throw new Error("Invalid " + method + " arguments:\n your last param can't be a callback function, \n please remove it and use \".subscribe\" of the Observable!"); } /** - * A class with static methods, which wraps Meteor's API and returns - * RxJS Observable as return value for all Meteor's API. - * The method's signature is the same as Metoer's, except you don't - * need to provide callbacks, and you need to "subscribe" instead. - * The functionality that wrapped in this implementation is Meteor.call, - * Meteor.autorun and Meteor.subscribe. - * + * 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 ] + * exception that the callbacks are handled by Meteor-rxjs. Instead of + * providing callbacks, you need to subscribe to the observables that are + * returned. The methods that are wrapped in MeteorObservable are + * [Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), + * [Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun) + * and [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe). */ var MeteorObservable = (function () { function MeteorObservable() { } /** - * Method has the same notation as Meteor.call, only without the callbacks: + * Invokes a [Meteor Method](https://docs.meteor.com/api/methods.html) + * defined on the server, passing any number of arguments. This method has + * the same signature as + * [Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), only + * without the callbacks: * MeteorObservable.call(name, [...args]) * - * @param {String} name - Name of the method in the Meteor server + * + * @param {string} name - Name of the method in the Meteor server * @param {any} args - Parameters that will be forwarded to the method. * after the func call to initiate change detection. - * @returns {Observable} - RxJS Observable, which completes when the server return a response. + * @returns {Observable} - RxJS Observable, which completes when the + * server returns a response. + * * @example Example using Angular2 Component * class MyComponent { * constructor() { @@ -531,16 +539,21 @@ var MeteorObservable = (function () { }); }; /** - * Method has the same notation as Meteor.subscribe, only without the callbacks: + * When you subscribe to a collection, it tells the server to send records to + * the client. This method has the same signature as + * [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe), + * except without the callbacks again: * subscribe(name, [...args]) * - * You can use this method from any Angular2 element - such as Component, Pipe or - * Service. + * You can use this method from any Angular2 element - such as Component, + * Pipe or Service. * - * @param {String} name - Name of the publication in the Meteor server + * @param {string} name - Name of the publication in the Meteor server * @param {any} args - Parameters that will be forwarded to the publication. * after the func call to initiate change detection. - * @returns {Observable} - RxJS Observable, which completes when the subscription is ready. + * @returns {Observable} - RxJS Observable, which completes when the + * subscription is ready. + * * @example Example using Angular2 Service * class MyService { * private meteorSubscription: Observable; @@ -620,7 +633,10 @@ var MeteorObservable = (function () { }); }; /** - * Method has the same notation as Meteor.autorun, only without the callback: + * Allows you to run a function every time there is a change is a reactive + * data sources. This method has the same signature as + * [Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun), + * only without the callback: * MeteorObservable.autorun() * * @returns {Observable} - RxJS Observable, which trigger the subscription callback diff --git a/docs/MeteorObservable.md b/docs/MeteorObservable.md index 9c5c59af..5aaa8c8a 100644 --- a/docs/MeteorObservable.md +++ b/docs/MeteorObservable.md @@ -1,12 +1,14 @@ ## MeteorObservable -A class with static methods, which wraps Meteor's API and returns -RxJS Observable as return value for all Meteor's API. -The method's signature is the same as Metoer's, except you don't -need to provide callbacks, and you need to "subscribe" instead. -The functionality that wrapped in this implementation is Meteor.call, -Meteor.autorun and Meteor.subscribe. +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 ] +exception that the callbacks are handled by Meteor-rxjs. Instead of +providing callbacks, you need to subscribe to the observables that are +returned. The methods that are wrapped in MeteorObservable are +[Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), +[Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun) +and [Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe). **Kind**: global class @@ -18,15 +20,20 @@ Meteor.autorun and Meteor.subscribe. ### MeteorObservable.call(name, ...args) ⇒ Observable.<T> -Method has the same notation as Meteor.call, only without the callbacks: +Invokes a [Meteor Method](https://docs.meteor.com/api/methods.html) +defined on the server, passing any number of arguments. This method has +the same signature as +[Meteor.call](https://docs.meteor.com/api/methods.html#Meteor-call), only +without the callbacks: MeteorObservable.call(name, [...args]) **Kind**: static method of [MeteorObservable](#MeteorObservable) -**Returns**: Observable.<T> - - RxJS Observable, which completes when the server return a response. +**Returns**: Observable.<T> - - RxJS Observable, which completes when the + server returns a response. | Param | Type | Description | | --- | --- | --- | -| name | String | Name of the method in the Meteor server | +| name | string | Name of the method in the Meteor server | | ...args | any | Parameters that will be forwarded to the method. after the func call to initiate change detection. | **Example** *(Example using Angular2 Component)* @@ -48,19 +55,23 @@ Method has the same notation as Meteor.call, only without the callbacks: ### MeteorObservable.subscribe(name, ...args) ⇒ Observable -Method has the same notation as Meteor.subscribe, only without the callbacks: +When you subscribe to a collection, it tells the server to send records to +the client. This method has the same signature as +[Meteor.subscribe](https://docs.meteor.com/api/pubsub.html#Meteor-subscribe), +except without the callbacks again: subscribe(name, [...args]) - You can use this method from any Angular2 element - such as Component, Pipe or - Service. + You can use this method from any Angular2 element - such as Component, + Pipe or Service. **Kind**: static method of [MeteorObservable](#MeteorObservable) -**Returns**: Observable - - RxJS Observable, which completes when the subscription is ready. +**Returns**: Observable - - RxJS Observable, which completes when the + subscription is ready. **See**: [Publications in Meteor documentation](http://docs.meteor.com/api/pubsub.html) | Param | Type | Description | | --- | --- | --- | -| name | String | Name of the publication in the Meteor server | +| name | string | Name of the publication in the Meteor server | | ...args | any | Parameters that will be forwarded to the publication. after the func call to initiate change detection. | **Example** *(Example using Angular2 Service)* @@ -110,7 +121,10 @@ Method has the same notation as Meteor.subscribe, only without the callbacks: ### MeteorObservable.autorun() ⇒ Observable.<T> -Method has the same notation as Meteor.autorun, only without the callback: +Allows you to run a function every time there is a change is a reactive +data sources. This method has the same signature as +[Meteor.autorun](https://docs.meteor.com/api/tracker.html#Tracker-autorun), +only without the callback: MeteorObservable.autorun() **Kind**: static method of [MeteorObservable](#MeteorObservable)