Closed mjarkk closed 2 years ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
vanmoof-web-controller | ✅ Ready (Inspect) | Visit Preview | Jun 23, 2022 at 9:53AM (UTC) |
Why did you change the next.config.js?
Why is createBikeSharingInvitation() a Promise<void>
?
Void means it doesn’t return anything right?
Why did you change the next.config.js?
I cannot obtain my bike shares without the change you made earlier so it seems like this change is needed
Why is createBikeSharingInvitation() a Promise?
If a function in async it always returns a Promise
hence why I've added that
Void means it doesn’t return anything right?
What is returning nothing?
In lower level languages like C++ you have void types for functions that latterly return nothing.
In javascript a function always returns something you can call a empty function and you won't get void but undefined
where undefined
is valid javascript a value.
With the changes I made to the error checking we don't need the response value anymore, we only have to check if the function succeeds or if it throws thus no need anymore for the response.
As the response value is not important I have labeled the response as void hinting the user of the method "you can ignore the response value"
I think this is a fine usage of the void type, reading the typescript docs it says:
Tough that all said this is a bit of a grey area and if we want to be fully compliant with typescript we should use empty return statements.
I cannot obtain my bike shares without the change you made earlier so it seems like this change is needed
have you tried to restart the npm run dev when my PR got approved? The api was working fine for me.
Yes I've tried that
Hmm weird…
@sanderDijkxhoorn here are some last things i wanted different in your pr but i didn't feel the need to comment on them as they where do not have high priority and would have bloated the pr's review process. Beside that i didn't want to overwhelm you with a fuckload of comments :) That said you might want to look into the changes to see what i've would do differently