This component is difficult to pull out without referencing a parent component who used it.
Additionally, VSCode cannot provide autocomplete for props.
Solution
Use the JSDOC standard.
/**
* This component does x y z
* @param {{data:number[],data2:string}} props
*/
export const component1 = (props) => {
//...
}
This should explain the reason for the page and what its arguments are.
The added advantage is that VSCode (and GitHub's Markdown, if you can notice) has JSDoc integration, and can read this and provide autocomplete.
Aim
This is an umbrella issue that has the following objectives
Progress
.then()
promise hell into readableasync-await
expressionsInformation
.then() Improvements
This piece of code can save different ways of fixing
Route 1 - Lesser
.then
calls.then
is not always required, except for working on a promise. Only axios here returns a promise, so it can be merged.Route 2 - Use Async await
Consider this alternate syntax:
Refer to
JSDoc
Problem
This component is difficult to pull out without referencing a parent component who used it. Additionally, VSCode cannot provide autocomplete for props.
Solution
Use the JSDOC standard.
This should explain the reason for the page and what its arguments are. The added advantage is that VSCode (and GitHub's Markdown, if you can notice) has JSDoc integration, and can read this and provide autocomplete.
Please refer https://jsdoc.app/about-getting-started.html