angular2-meteor-rxjs
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.3 • Public • Published

Build Status npm version

angular2-meteor-rxjs

Helpers for mapping meteor autorun contexts to observables

Remember that all of the exported observables are cold. That means that you have to subscribe before any action is taken, or you have to make them hot by other means.

Usage

AutorunObservable

Takes a callback as parameter that is run within an autorun context.

import {AutorunObservable} from 'angular2-meteor-rxjs';
 
let observable = new AutorunObservable<User[]>(() => {
    Meteor.subscribe('users.all');
    return Meteor.users.find({'profile.name': 'Joatin'}).fetch();
})

MeteorMethodObservable

Takes the name of the method and the parameters and wraps the result of the call into a observable.

import {MeteorMethodObservable} from 'angular2-meteor-rxjs';
 
let observable = new MeteorMethodObservable<string>('texts.insert', 'sample text');

ValidatedMethodObservable

Takes the validated method and the parameters and wraps the result of the call into a observable.

import {ValidatedMethodObservable} from 'angular2-meteor-rxjs';
import {insertText} from './both/methods/texts.methods';
 
let observable = new ValidatedMethodObservable<string>(insertText, 'sample text');

Readme

Keywords

Package Sidebar

Install

npm i angular2-meteor-rxjs

Weekly Downloads

2

Version

1.0.0-beta.3

License

MIT

Last publish

Collaborators

  • joatin