How is the mini-cart's dropdown implemented?

Initialization

Step 1

Step 2

Step 3

Step 4

Step 5

Layout

Template

dropdownDialog

See also:

Thank you for this, but I’m still really confused, hopefully you can help. I don’t see how “sidebar.js” is linked to “minicart.js”. I see that “sidebar” is a dependency in “minicart”, so it waits for it to load. But it’s not a parent / child relationship, is it? Yet somehow, when things are updated in the cart, it triggers events and functions in sidebar for resizing, etc, and it’s not clear how or why it does this. Can you help explain?