0👍
let session = obtainSession(this.session_id)
.then(session=> {
return session
});
Doing this doesn’t mean this will return after the then
– it will return immediately with the Promise returned by obtainSession. The continuation will also run once the promise resolves, but that return is basically meaningless in this flow.
You will have to await this call. Or if you log inside the then
you’ll see the result.
You could consider retrieving this and awaiting inside mounted
or similar, or have the code set session
as a module variable. But in all cases this is going to be something that returns a promise you have to wait for outside of tHat assignment.
- [Vuejs]-Can i add mongodb _id to localhost adress to display one post from database?
- [Vuejs]-Problems with reactivity and computed properties Vue 3 – Composition API
Source:stackexchange.com