StorytellerCZ / meteor-promise

Utilities for Promise-based wrappers, method calls, helpers and HTTP in Meteor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deanius:promise

Build Status ES 2015 Version Info Codacy Badge twitter link

Install

meteor add deanius:promise

API

The deanius:promise package gives you the following functionality:

  • Meteor.callPromise - The same as Meteor.call, but you omit the callback parameter, and it returns a Promise for the result
  • Meteor.runAsync - Uses the co NPM Library to run a JavaScript generator function yielding promises, as though it were synchronous
  • HTTP.getPromise - All methods on the HTTP object will have Promise-returning versions, just append Promise onto the method name.
  • Meteor.subscribe - The object returned by Meteor.subscribe will have a readyPromise() function which, when called, returns a Promise that resolves when ready() returns true.
  • Meteor.wrapPromise - Takes any callback-style function, and returns a Promise-returning function. This is like Meteor.wrapAsync, but useful on the client.
  • ReactivePromise - A function to wrap Promise-returning functions with, to create reactive functions - such as helpers - which update when their promised value becomes available.

Thoughts? Questions? Open an issue in deanius:promise, and let's discuss. Or find me on social media. Thanks for your interest!

About

Utilities for Promise-based wrappers, method calls, helpers and HTTP in Meteor


Languages

Language:JavaScript 100.0%