task

CREATE-article# #

[previously]

  1. [2017-08-25][00:00] NEW task IN ?
    1. ] # 7389 - CREATE-article# # 
  2. [00:00] NEW article IN 
    1. ] # # -  jquery defferred - mastering the art of the promise 

[currently]

  1. [] PASS - 
    1. ] EXAMPLE  
  2. [] 
  3. [] todo
    1. x] add create-article task, # 7389, this
    2. x] add reference to this task on index
    3. x] add reference to index on this task
    4. ] content - add reference to video tutorials ( get BM from saf)
    5. ] content - add notes from scrap
    6. ]

[next]

  1. ]
  2. ] entering the lovely world of asynch calllback handling with 
  3. ] the OnSuccess callback being passed to so many
  4. ] var OnSuccess - defining the OnSuccess callback handler in your , EX on pg 

[reference]

  1. ] # 7380 - project-00n - index - list of all articles related to this project 
  2. ] # 7354 - LIST-contract#-026 - previous notes on jq deferred / js promises
  3. ] # 7376 - 2017-06-20 - misc 
  4. Promises, Promises: Unlocking the Power of jQuery's Deferreds - Brian Klaas - YouTube 
  5. How to Use Javascript Promises - YouTube 
  6. JavaScript Promises: The Basics - YouTube 
  7. An Intro to AJAX Promises in jQuery - YouTube 
  8. ] youtube ? = 'jquery deferred tutorial'

 
] Promises are a cleaner way of doing javascript callbacks
] better way of handling 'asynch' operations
] promise are part of the js standard in es6
] use 1 deferred object VS using multiple callbacks, ex ( OnSuccess, OnFailure, ...)
] promises have a 'status' property, the status can be either 'pending' or 'resolved'
] the status property is immutiable, aka it cannot be changed by other objects code, other then when the . 

EXAMPLE - generic
return $.deferred => {
$.when( getSomething() )
.done( (something) 
doSomething(something) )
}.promise();
 

EXAMPLE - specific - single object 
return $.deferred => {
$.when ( getAvailableCar() )
.done((car) => { 
 car.availability = false;
// process EX = carsAvailable.push(car);
 
}) 
}.promise(); 
Details Photos Edit more

Details

ID: 7389

NAME: CREATE-article-jquery-deferred-aka-promises

DESCRIPTION: [idx] PASS - query deferred - mastering the art of the promise

START DATE TIME: 2017-08-24 22:57:12

EST DURATION: 01:00:00

END DATE TIME: 2017-08-24 23:57:12

STATUS: To-Do

PRIORITY: -5

OWNER ID: 1

Content Photos Edit more

photos

photos for this task

actions

Agenda Email task SMS task Priorities