Sometimes you need to load something once, like a script, and you need to execute your code only after loading it. For example, you have some magical library, but it weights around 1 MB, so you don’t want to just load it, until you actually use it. One possible solution would be to use code splitting, but let’s assume it is not a viable solution (also this approach is good not only for scripts).