Skip to content
Advertisement

Tag: asynchronous

Nuxt How to send async props

I’ve been having trouble with Nuxt2.15 (Vue.js). I want to send the data from parent component to child component that parent components fetched. And, I want to fetch another data from a child component by useing the data from the parent component. But props data is undefined in the child component. I tried to use “watch” and “computed” in the child

Property does not exist on type void

I am writing a hook to make a post request that returns two properties, sessionId and sessionData. I am using this hook in a component. My hook looks like this. And my component look like this When I try to access data.sessionData on the component I get the error that sessionDta does not exist on type void. But If I

Calculate Value from JS Promise

I have assigned a callback function to a variable. The function then returns a promise stating it is fulfilled and the value. I want to be able to return the value and use it to perform a mathematical calculation. Javascript code: In the console I get the below output. Answer Assuming this is the interface you’re using, this is an

Conditionally load and then reference external JS

I’d like to load an external JS script based on a condition (the user’s screen width), then execute a script which references that external JS. I want to load the external JS as early as possible, so I’ve added it to the <head>, but when referencing the JS later in the <body>, it shows as undefined. I assume this is

Why doesn’t .then() need the async keyword when used (similar to await)? How does Javascript know it’s an asynchronous operation?

I’m starting to learn asynchronous Javascript and I’m really confused. To be honest, the async/await approach seems very logical to me. We need to let the runtime know we’re doing an asynchronous operation so it can handle it accordingly. But why don’t we need to do the same when using the .then() method? I mean, if Javascript was already able

Advertisement