Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 846959 - Ensure syncComplete event fires and allow callback in syncC... #8415

Merged

Conversation

lightsofapollo
Copy link
Contributor

...ontroller.all

@@ -44,9 +44,14 @@ Calendar.ns('Controllers').Sync = (function() {
* controller.once('syncComplete', cb);
*
*/
all: function() {
all: function(callback) {
if (callback) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be cleaner to always just rely on the syncComplete function instead of callback? I suppose this is a smaller fix for now, but it seems odd to have two hooks IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to fix across all branches... stupid of me really... less mocking in tests required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - let's go with this for now then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less mocking in tests required.
or better mocking ? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both!!! One of the things I liked about Sinon is it would alert you of stupid mistakes like missing function or argument mis matches...

On Mar 2, 2013, at 1:09 PM, Julien Wajsberg notifications@github.com wrote:

In apps/calendar/js/controllers/sync.js:

@@ -44,9 +44,14 @@ Calendar.ns('Controllers').Sync = (function() {
* controller.once('syncComplete', cb);
*
*/

  • all: function() {
  • all: function(callback) {
  •  if (callback) {
    
    less mocking in tests required.
    or better mocking ? :)


Reply to this email directly or view it on GitHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'd like to try Sinon as well :)

KevinGrandon added a commit that referenced this pull request Mar 2, 2013
Bug 846959 - Ensure syncComplete event fires and allow callback in syncController r=kgrandon
@KevinGrandon KevinGrandon merged commit 22ab6a7 into mozilla-b2g:master Mar 2, 2013
KevinGrandon added a commit that referenced this pull request Mar 5, 2013
Bug 846959 - Ensure syncComplete event fires and allow callback in syncController r=kgrandon(cherry picked from commit 22ab6a7)
KevinGrandon added a commit that referenced this pull request Mar 5, 2013
Bug 846959 - Ensure syncComplete event fires and allow callback in syncController r=kgrandon(cherry picked from commit 22ab6a7)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants