My FeedDiscussionsHeadless CMS
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Omar Hiari

4 comments

Christian Foucher
Christian Foucher
Aug 11, 2023

Hello Omar,

I propose a refactoring in your github repository (see issue #2).

I admit that it was not straight forward to write the parameters of the function!

·
·3 replies
Omar Hiari
Omar Hiari
Author
·Aug 13, 2023

Thank you for your contribution Christian Foucher! Actually, yes, given all the different types in embedded and the singleton pattern, setting up function parameters can take a while to digestive. This is why I try to avoid them in beginner tutorials. Maybe it's a topic for a separate blog post.

I revised your refactor and yes, I am printing the value regardless of the update. I will update the post and repo to incorporate this as an optimization.

·
Christian Foucher
Christian Foucher
Aug 14, 2023

Omar Hiari I have another suggestion. It concerns the displayed message. I have added a remark to the issue #2 on github repository (more clear than typing it here). It is about the decimal that can't be displayed because of the computation that gives an integer result. By the way, it permits to increase timer resolution in the displayed message.

·
Omar Hiari
Omar Hiari
Author
·Aug 16, 2023

Thanks Christian Foucher, I will adjust this. It's an artifact left over as I was experimenting with floating point before. I decided to avoid floating point operations but forgot to adjust this.

·