Skip to content

Commit

Permalink
Updated use_deferred comment and fixed some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwdan committed Dec 8, 2014
1 parent 16f2d28 commit fc03fea
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/angular-wamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function $WampProvider() {
* Options that control what kind of Deferreds to use:
*
* - `use_es6_promises`: `{boolean=}` - use deferreds based on ES6 promises
* - `use_deferred`: `{callable=}` - if provided, use this deferred constructor, e.g. jQuery.Deferred or Q.defer
* - `use_deferred`: `{callable=}` - if provided, use this deferred constructor, e.g. jQuery.Deferred or Q.defer (default: $q.defer)
*
* Options that control automatic reconnection:
*
Expand Down Expand Up @@ -244,19 +244,20 @@ function $WampProvider() {
var deferred = $q.defer();

sessionPromise.then(
function(session) {
function (session) {
var publishPromise = session.publish(topic, args, kwargs, options);

if (publishPromise) {
publishPromise.then(
function(publication) {
function (publication) {
deferred.resolve(publication);
}
);
}
else
else {
deferred.resolve(true);
}
}
}
);

return deferred.promise;
Expand All @@ -268,9 +269,9 @@ function $WampProvider() {
var deferred = $q.defer();

sessionPromise.then(
function(session) {
function (session) {
session.register(procedure, endpoint, options).then(
function(registration) {
function (registration) {
deferred.resolve(registration);
}
);
Expand All @@ -284,9 +285,9 @@ function $WampProvider() {
var deferred = $q.defer();

sessionPromise.then(
function(session) {
function (session) {
session.call(procedure, args, kwargs, options).then(
function(result) {
function (result) {
deferred.resolve(result);
}
);
Expand Down

0 comments on commit fc03fea

Please sign in to comment.