WHAT’S IN THIS CHAPTER?
- Using chainable methods to create more elegant code
- Using test-driven development to implement chainable methods
- Writing DRY unit tests to verify that methods are chainable
- Showing how the
thenmethod of ECMAScript 6 promises enables chaining
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
The wrox.com code downloads for this chapter are found at
http://www.builtwith.com in March 2015.
The jQuery code sample illustrates the use of chainable methods: functions constructed so they can be invoked one after another on the same object in a single statement.
then method of the
Promise API used throughout the book is chainable.