Hey @gmeral
thanks for commenting. You are right, in the current implementation, the request will be executed each time the component is created.
Your suggestion is pretty good.
The only thing I'd do there is changing the promises callbacks to async/await
In my personal projects, I've done something similar to your implementation.
But I pass a boolean intermediate prop combined with a params watcher.
Like this:
The difference is that this doesn't allow me to make different requests but the same one with different parameters.
I kind of don't see with good eyes scenarios where you might populate the same variable and context with different requests results, but it might happen.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey @gmeral thanks for commenting. You are right, in the current implementation, the request will be executed each time the component is created.
Your suggestion is pretty good.
The only thing I'd do there is changing the promises callbacks to async/await
In my personal projects, I've done something similar to your implementation.
But I pass a boolean intermediate prop combined with a params watcher.
Like this:
The difference is that this doesn't allow me to make different requests but the same one with different parameters.
I kind of don't see with good eyes scenarios where you might populate the same variable and context with different requests results, but it might happen.