https://bugzilla.wikimedia.org/show_bug.cgi?id=37982

       Web browser: ---
             Bug #: 37982
           Summary: Use .done() instead of .then() when adding
                    success-handlers on Promise objects
           Product: MediaWiki extensions
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Wikidata
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


Hi,

I didn't know where else to put it so I'll write it here. When randomly looking
through a diff on Gerrit I noticed a few mentions of this the following (it
wasn't changed in that commit, but shown in the diff context):

---
»       this.performApiAction( action )
»       »       .then( degrade );
---
»       var deferred = this.performApiAction( this.API_ACTION.SAVE )
»       »       .then( $.proxy( ... ) );
---
etc.

.then is literally just this:
> then: function( doneFns, failFns, progressfns ) {
>     deferred.done( doneFns ).fail( failFns ).progress( progressfns );
>     return this;
> },

So just use .done(). Even when binding both 'done' and 'fail' at the same time,
I'd still recommend using them directly for clarity, but that's just me :)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to