Within my document object, there is a property called isLoaded which indicates if information about a project has been loaded. Upon opening a project, the code loads the document and sets isLoaded to true.
I am looking for a way to create a promise that will wait until isLoaded becomes true before triggering some additional code (ex: X). How can I achieve this using JavaScript?