Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

How to get access localStorage Nuxt.config.ts version 3? #9267

Closed
4 tasks done
Hari111142 opened this issue Nov 23, 2022 · 0 comments
Closed
4 tasks done

How to get access localStorage Nuxt.config.ts version 3? #9267

Hari111142 opened this issue Nov 23, 2022 · 0 comments

Comments

@Hari111142
Copy link

Describe the feature

Hi Team,

I tried the below code it's working fine but my concern is that I need to store the data or value in the session storage and to use data globally

async function getToken() {
const response = await axios.get(
"api/url",
);
const data = await response;
return data;
}
(async () => {

return (await getToken()).data;

})()

let resToken = getToken();
console.log(resToken) // Promise { }

resToken.then(function(result) {
console.log(result.data); // "Some User token"
})

Thanks in Advance

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@nuxt nuxt locked and limited conversation to collaborators Nov 23, 2022
@danielroe danielroe converted this issue into a discussion Nov 23, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants