naming-cheatsheet
                                
                                 naming-cheatsheet copied to clipboard
                                
                                    naming-cheatsheet copied to clipboard
                            
                            
                            
                        Change asynchronous get to fetch suggestion.
In the example displayed currently in the notes, it suggests that the asynchronous function would return instantaneously when it could return errors or throw. In my opinion, it would be better to recommend a namespace in which would reflect that accordingly.
The current example:
You can use
getwhen performing asynchronous operations as well:
async function getUser(id) {
  const user = await fetch(`/api/user/${id}`)
  return user
}
The proposed change:
fetchYou can use
fetchwhen performing asynchronous operations as well:
async function fetchUser(id) {
  const user = await fetch(`/api/user/${id}`)
  return user
}
The ideaology behind my suggestion is as follows. When you're playing fetch with a dog, the dog does not always immediately return. The dog may get distracted or while returning drop it before returning to the handler, thus erroring out and dropping the return.
Why did you request my review since my previous comment is still open and unaddressed?
Why did you request my review since my previous comment is still open and unaddressed?
Appears actually to be an error with GitHub mobile. I had requested a review on a private repository.
I'll address your requested changes asap! I apologize for the inconvenience.
I thing fetch should be in another cases.
get for returning value
const getUser = () => {
  return fetch('/user').then(res => res.json());
};
const user = await getUser();
console.log(user);
fetch for fetching data to some variable
let user;
const fetchUser = async () => {
  const res = await fetch('/user').then(res => res.json());
  user = res;
};
await fetchUser();
console.log(user);