title: How do I create an onReady promise in JS App
body: <p>There is some Advanced topics in JS I am learning and there is something I am trying to understand.</p>
  
  <p>I've written a VueJS application and I need to expose some data and possibly methods from Vue outside of Vue itself. I am using vuex.</p>
  
  <p>This is so that users can use normal JS on the front end to extend the application.</p>
  
  <p>The idea is the user would add something like this on the front end. I have seen several JS frameworks/apps that do something like this.</p>
  
  <p><code>AppName.onReady.then(function(instance) {
      // use the instance object
      var email = instance.data["email"]
      var name = instance.data["name"]
      var isComplete = member.isComplete
  })</code></p>
  
  <p>Now what I am trying to understand is the code I would need in my App to make the above work.</p>
  
  <p>I know from the code it is a Class AppName that is invoked with new AppName({}) and it has a promise that gets resolved but not sure how to accomplish it.</p>