New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-meteor-promiser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-meteor-promiser - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

README.md

20

angular-meteor-promiser.js

@@ -14,14 +14,8 @@ "use strict";

return this._promise(function (resolve, reject) {
console.log('sub');
var handle = meteor_1.Meteor.subscribe.apply(meteor_1.Meteor, [name].concat(args, [{
onReady: function () {
console.log('onready');
resolve(handle);
},
onStop: function () {
console.log('onstop');
reject();
},
onError: function () {
console.log('onerror');
}

@@ -63,6 +57,14 @@ }]));

};
Promiser.prototype.any = function (fn) {
return this._promise(function (resolve, reject) {
try {
resolve(fn());
}
catch (error) {
reject(error);
}
});
};
Promiser.prototype._promise = function (fn) {
var d = this.$q.defer();
fn(d.resolve, d.reject);
return d.promise;
return this.$q(fn);
};

@@ -69,0 +71,0 @@ return Promiser;

@@ -16,14 +16,8 @@ import * as angular from 'angular';

return this._promise((resolve, reject) => {
console.log('sub');
const handle = Meteor.subscribe(name, ...args, {
onReady() {
console.log('onready');
resolve(handle);
},
onStop() {
console.log('onstop')
reject();
},
onError() {
console.log('onerror');
}

@@ -58,8 +52,14 @@ });

public any(fn) {
return this._promise((resolve, reject) => {
try {
resolve(fn());
} catch (error) {
reject(error);
}
});
}
private _promise(fn) {
const d = this.$q.defer();
fn(d.resolve, d.reject);
return d.promise;
return this.$q(fn);
}

@@ -66,0 +66,0 @@ }

{
"name": "angular-meteor-promiser",
"version": "0.0.1",
"version": "0.1.0",
"description": "Turns Meteor subscribe, call, apply callbacks into promises",

@@ -5,0 +5,0 @@ "main": "angular-meteor-promiser.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc