1. #1
    Sencha User
    Join Date
    May 2011
    Location
    Italy
    Posts
    72
    Vote Rating
    7
    Wilky is on a distinguished road

      0  

    Default Ext.ux.Deferred

    Ext.ux.Deferred


    Hey guys!

    Today I'm gonna to present javascript promises for ExtJS and Sencha Touch!
    Hell yeah!
    Nowadays, lots of frameworks and libraries have implemented promises: ExtJS/Sencha Touch wont be less so!

    Here's the problem:

    Code:
    aSync1 (10, function (val1) {
      aSync2 (val1, function (val2) {
        aSync3 (val2, function (val3) {
          alert ('Top of the pyramid with: ', val3);         
          });     
        }); 
    });
    and here the solution:

    Code:
    aSync1 (10)     
        .then (aSync2)     
        .then (aSync3)     
        .then (function (val3) {         
          alert ('End of the queue with: ', val3);     
        }); 
    });
    This is only one of the extraordinary things that Ext.ux.Deferred allows you to do!
    For more examples, read the docs on the github page: https://github.com/wilk/Ext.ux.Deferred

    For class documentation, lunch jsduck

    Sencha Market: https://market.sencha.com/extensions/ext-ux-deferred

    Enjoy it!

    Ciao!
    Wilk
    Last edited by Wilky; 22 May 2013 at 11:22 PM. Reason: added sencha market link

  2. #2
    Sencha - Senior Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,044
    Vote Rating
    993
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  

    Default


    Very nice work!
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2011
    Location
    Italy
    Posts
    72
    Vote Rating
    7
    Wilky is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Very nice work!
    Thanks

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    362
    Vote Rating
    42
    Scorpie will become famous soon enough Scorpie will become famous soon enough

      0  

    Default


    Is this modeled after Promises/A ?
    I`m from Holland!

  5. #5
    Ext Premium Member
    Join Date
    Aug 2010
    Posts
    12
    Vote Rating
    1
    dpatten69 is on a distinguished road

      0  

    Default


    Anybody using DeftJS promises/deferreds? how it compare, they implement the Promises/A spec.
    http://deftjs.org/

  6. #6
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,090
    Vote Rating
    56
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      1  

    Default


    For anyone who stumbles on this, promises are now in Sencha Touch 2.3 (and space)
    Lead Trainer / Sencha Specialist
    Teahouse Training Company

    Comprehensive Javascript, Sencha and 3rd Party Stack Training available worldwide online, and onsite in APAC, written by certified official Sencha trainers.



    Unofficial Sites:

    SenchaWorld.com - Videos, and stuff
    Sencha.Community - Tools, Extensions and Resources
    TeahouseHQ.com - Sencha Ecosystem Training Portal

    Code Validation : JSLint | JSONLint | JSONPLint

  7. #7
    Sencha User
    Join Date
    May 2011
    Location
    Italy
    Posts
    72
    Vote Rating
    7
    Wilky is on a distinguished road

      0  

    Default


    Good to hear it!

  8. #8
    Sencha User
    Join Date
    Dec 2011
    Posts
    10
    Vote Rating
    0
    M165437 is on a distinguished road

      0  

    Default


    Quote Originally Posted by dawesi View Post
    For anyone who stumbles on this, promises are now in Sencha Touch 2.3 (and space)
    Are you referring to Ext.Promise? It's marked private. Am I missing something non-private? Are there any example on how to use this?

    Thanks!