Chaining Callbacks


Chaining Callbacks with Continuation Passing Style

The Continuation Passing Style(CPS) is a programming style used to chain callback functions together. In CPS, methods with callback functions as arguments are called within other callback functions. CPS is characterized by having methods that have callback functions as their last argument.

Notice how callbacks can be chained with the Continuation Passing Style:



CPS has a tendency to become difficult to manage as more and more callback functions are chained together. We will cover better methods to chain callbacks together later in this course.

results matching ""

    No results matching ""