10. alex.define()
Important, life altering facts:
• Sublime Text 2
11. alex.define()
Important, life altering facts:
• Sublime Text 2
• Railscasts 2 color
scheme
12. alex.define()
Important, life altering facts:
• Sublime Text 2
• Railscasts 2 color
scheme
• Comma Last
13. alex.define()
Important, life altering facts:
• Sublime Text 2
• Railscasts 2 color
scheme
• Comma Last
• Always include
semicolons
14. alex.define()
Important, life altering facts:
• Sublime Text 2 • Boston to Boulder
• Railscasts 2 color
scheme
• Comma Last
• Always include
semicolons
15. alex.define()
Important, life altering facts:
• Sublime Text 2 • Boston to Boulder
• Railscasts 2 color • Quick Left
scheme
• Comma Last
• Always include
semicolons
16. alex.define()
Important, life altering facts:
• Sublime Text 2 • Boston to Boulder
• Railscasts 2 color • Quick Left
scheme
• Front End
• Comma Last
• Always include
semicolons
17. alex.define()
Important, life altering facts:
• Sublime Text 2 • Boston to Boulder
• Railscasts 2 color • Quick Left
scheme
• Front End
• Comma Last
• Training and CU
• Always include
semicolons
33. deferred.history
• November 2009, $.ajax
requests
• Julian Aubourg steps up,
rewrites
• Suggested that internal
API be exposed
34. deferred.history
• November 2009, $.ajax
requests
• Julian Aubourg steps up,
rewrites
• Suggested that internal
API be exposed
• Reworked, released
January 2010
35. deferred.history
• November 2009, $.ajax • ‘Based on’ CommonJS
requests Promises/A proposal
• Julian Aubourg steps up,
rewrites
• Suggested that internal
API be exposed
• Reworked, released
January 2010
36. deferred.history
• November 2009, $.ajax • ‘Based on’ CommonJS
requests Promises/A proposal
• Julian Aubourg steps up, • Used internally in
rewrites jQuery, AJAX and effects
• Suggested that internal
API be exposed
• Reworked, released
January 2010
37. deferred.history
• November 2009, $.ajax • ‘Based on’ CommonJS
requests Promises/A proposal
• Julian Aubourg steps up, • Used internally in
rewrites jQuery, AJAX and effects
• Suggested that internal • How do we use it?
API be exposed
• Reworked, released
January 2010
78. 2. Template Pattern
Task at hand: Single page app, some pages need data, others don’t
Any object that isn’t a deferred can still be
treated like one.
79. 2. Template Pattern
Task at hand: Single page app, some pages need data, others don’t
Any object that isn’t a deferred can still be
treated like one.
It will get immediately resolved.
88. 4. Pretty Syntax
Task at hand: Make your javascript look awesome
a) setTimeout(500, myFunction)
b) setTimeOut(myFunction, 500)
c) setTimeOut(500, myFunction)
d) setTimeout(myFunction, 500)
89. 4. Pretty Syntax
Task at hand: Make your javascript look awesome
a) setTimeout(500, myFunction)
b) setTimeOut(myFunction, 500)
c) setTimeOut(500, myFunction)
d) setTimeout(myFunction, 500) <<<
90. 4. Pretty Syntax
Task at hand: Make your javascript look awesome
a) setTimeout(500, myFunction)
b) setTimeOut(myFunction, 500)
c) setTimeOut(500, myFunction)
d) setTimeout(myFunction, 500) <<<
91. 4. Pretty Syntax
Task at hand: Make your javascript look awesome
a) setTimeout(500, myFunction)
b) setTimeOut(myFunction, 500)
c) setTimeOut(500, myFunction)
d) setTimeout(myFunction, 500) <<<
96. 4. Pretty Syntax
Task at hand: Make your javascript look awesome
The natural-language syntax is already
there, but feel free to add your own.
Return promises
106. 5.Arbitrary ‘events’
Task at hand: Get updates during a longer process
.progress() callbacks fired with
.notify() can let you get insight
into long running processes
$.Animation and HTML5 file upload
107. 6. Managing
Animations
Task at hand: Implement a complex animation with tight tolerances
Built in helper methods generate promises on their DOM nodes:
108. 6. Managing
Animations
Task at hand: Implement a complex animation with tight tolerances
Built in helper methods generate promises on their DOM nodes:
• .animate()
• .fadeIn()
• .fadeOut()
• .hide()
• .show()
• .slideUp()
• .slideDown()
• .Animate()
116. Things I didn’t even
mention but are still
awesome:
• Registering multiple callbacks!
117. Things I didn’t even
mention but are still
awesome:
• Registering multiple callbacks!
• Post-resolution binding!
118. Things I didn’t even
mention but are still
awesome:
• Registering multiple callbacks!
• Post-resolution binding!
• Helpful .then(d, f) shortcut syntax!
119. Things I didn’t even
mention but are still
awesome:
• Registering multiple callbacks!
• Post-resolution binding!
• Helpful .then(d, f) shortcut syntax!
• Dependent AJAX calls!
120. Things I didn’t even
mention but are still
awesome:
• Registering multiple callbacks!
• Post-resolution binding!
• Helpful .then(d, f) shortcut syntax!
• Dependent AJAX calls!
• Memoizing expensive operations!
121. Things I didn’t even
mention but are still
awesome:
• Registering multiple callbacks!
• Post-resolution binding!
• Helpful .then(d, f) shortcut syntax!
• Dependent AJAX calls!
• Memoizing expensive operations!
• Implementing a publisher/subscriber pattern!
125. Deferred best practices
• When in doubt, return a deferred
• Better yet, return a .promise()
• Powerful as properties on objects
126. Deferred best practices
• When in doubt, return a deferred
• Better yet, return a .promise()
• Powerful as properties on objects
• Make you code prettier
127. Deferred best practices
• When in doubt, return a deferred
• Better yet, return a .promise()
• Powerful as properties on objects
• Make you code prettier
• Make your life easier
130. What we covered:
• Bundling AJAX calls together
• Normalizing by using .done on non-deferreds
131. What we covered:
• Bundling AJAX calls together
• Normalizing by using .done on non-deferreds
• Implementing cache objects
132. What we covered:
• Bundling AJAX calls together
• Normalizing by using .done on non-deferreds
• Implementing cache objects
• Prettier syntax and DSLs
133. What we covered:
• Bundling AJAX calls together
• Normalizing by using .done on non-deferreds
• Implementing cache objects
• Prettier syntax and DSLs
• Progress on long-running operations
134. What we covered:
• Bundling AJAX calls together
• Normalizing by using .done on non-deferreds
• Implementing cache objects
• Prettier syntax and DSLs
• Progress on long-running operations
• Manage animations
135. talk.resolve()
• @alexmcpherson
• McPhersonIndustries.com
Credits:
j@ubourg
bit.ly/JvD71E [MSDN Addy/Julian]
bit.ly/MIOIK2 [Intridea Defs post]
Quick Left (esp. Sam and Nico)