Establish Callback and Closure patterns Around Async Browser Behaviors
Offered By: egghead.io
Course Description
Overview
JavaScript is full of inconsistent APIs. Wrapping those APIs in functions allows you to have full control over how to configure them and make them more reusable.
This becomes even more beneficial when dealing with the async nature of JavaScript. You'll learn how a broadcaster is a function that wraps another function (which we call listeners) and modifies the behavior. We will build up this pattern in a way that allows you to compose broadcasters together making your code more reusable.
You're in Section 02 of Composing Closures and Callbacks in JavaScript
This becomes even more beneficial when dealing with the async nature of JavaScript. You'll learn how a broadcaster is a function that wraps another function (which we call listeners) and modifies the behavior. We will build up this pattern in a way that allows you to compose broadcasters together making your code more reusable.
You're in Section 02 of Composing Closures and Callbacks in JavaScript
Syllabus
- Create a Function to Configure setTimeout
- Return a Function to Cancel an Async Behavior
- Wrap addEventListener in a Function for More Control
- Create a Utility Function to Control setInterval
- Combine Multiple Async Behaviors with a Merge Function
- Use Lodash Curry When Functions Return Functions
- Match Function Requirements with Lodash Partial and Flip
- Create a Buffer to Pair Values Together with Zip
- Pass an Array to a Callback with a forOf Function
- Pass a Done Symbol when an Async Function is Done
Taught by
John Lindquist
Related Courses
Programming LanguagesUniversity of Virginia via Udacity Building a Basic Website
University of Massachusetts Amherst via Independent iDESWEB, Introducción al desarrollo web
MirÃadax Web Engineering II: Developing Mobile HTML5 Apps
Technische Hochschule Mittelhessen via iversity Web Application Architectures
University of New Mexico via Coursera