Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 2b7da5c

Browse files
committed
Fix styling nits
1 parent fa95e35 commit 2b7da5c

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

angularfire.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -243,33 +243,40 @@
243243
// Update a value within a transaction. Calling this is the
244244
// equivalent of calling `transaction()` on a Firebase reference.
245245
//
246-
// * `updateFn`: A developer-supplied function which will be passed the current data
247-
// stored at this location (as a Javascript object). The function should
248-
// return the new value it would like written (as a Javascript object).
249-
// If "undefined" is returned (i.e. you "return;" with no arguments) the
250-
// transaction will be aborted and the data at this location will not be modified.
251-
// * `applyLocally`: By default, events are raised each time the transaction update function runs. So
252-
// if it is run multiple times, you may see intermediate states. You can set this
253-
// to false to suppress these intermediate states and instead wait until the
246+
// * `updateFn`: A developer-supplied function which will be passed
247+
// the current data stored at this location (as a
248+
// Javascript object). The function should return the
249+
// new value it would like written (as a Javascript
250+
// object). If "undefined" is returned (i.e. you
251+
// "return;" with no arguments) the transaction will
252+
// be aborted and the data at this location will not
253+
// be modified.
254+
// * `applyLocally`: By default, events are raised each time the
255+
// transaction update function runs. So if it is run
256+
// multiple times, you may see intermediate states.
257+
// You can set this to false to suppress these
258+
// intermediate states and instead wait until the
254259
// transaction has completed before events are raised.
255260
//
256-
// This function returns a promise that will be resolved when the transaction function has completed.
257-
// A successful transaction is resolved with the snapshot. If the transaction is aborted,
261+
// This function returns a promise that will be resolved when the
262+
// transaction function has completed. A successful transaction is
263+
// resolved with the snapshot. If the transaction is aborted,
258264
// the promise will be resolved with null.
259265
object.$transaction = function(updateFn, applyLocally) {
260266
var deferred = self._q.defer();
261-
self._fRef.ref().transaction(updateFn, function(err, committed, snapshot) {
262-
if(err) {
263-
deferred.reject(err);
264-
} else if(!committed) {
265-
deferred.resolve(null);
266-
} else {
267-
deferred.resolve(snapshot);
268-
}
269-
}, applyLocally);
267+
self._fRef.ref().transaction(updateFn,
268+
function(err, committed, snapshot) {
269+
if (err) {
270+
deferred.reject(err);
271+
} else if (!committed) {
272+
deferred.resolve(null);
273+
} else {
274+
deferred.resolve(snapshot);
275+
}
276+
},
277+
applyLocally);
270278
};
271279

272-
273280
// Remove this object from the remote data. Calling this is the
274281
// equivalent of calling `remove()` on a Firebase reference. This
275282
// function takes a single optional argument:

0 commit comments

Comments
 (0)