This tutorial demonstrates and explains how you can create practical promise-based functions that will let you chain your code together so that it always runs in a specific sequence.
Code from video: https://gist.github.com/prof3ssorSt3v3/608709ed47dd9af79472dca8d4fa685c