How to pull value out of promise

Viewed 8715

I have this code below: How can i pull the value out of this promise?

  var value = Auth.loggedinUser().then(function (user){
    return user.id
  });

  console.log(value)

This is my promise below:

Promise {$$state: Object}
    $$state:Object
    status:1
    value:2
__proto__:Object
__proto__:Object

I am trying to just get the value out and set it to my value variable. Which should be 2 or whatever it would return.

My goal is to set the value of the promise to a global variable if possible

1 Answers
Related