Hello @MarcoOquendoC โ,
Here I have highlighted some points that will help you improve your project.
Organise the project structure well
You have put your module js files in a folder called assets while it's a convention that the assets folder always contains files like images, SVGs, and other static assets. Please create a folder called modules at the root level of the project repo and then add your js module files there
Again inside the same folder, I have seen that there are test files there too. It is better to separate the concerns. In order words, tests in their own folder called __tests__ and other js files apart.
Preserving immutability of objects (eg: Arrays)
In your methood.js file, I have seen that in order to add a new task in the tasks array, you used the push method of the array object. While there is no significant problem with it, this method mutates(changes) the original array by adding a new item. Modern development encourages using ways that don't mutate the original object but rather use a copy of it. So the best option, in that case, is using the Higher order function Concat() which is called on the array, It creates a copy of that array, adds new items and then returns that copy ๐ ๐ So please use it instead ๐
Hello @MarcoOquendoC โ, Here I have highlighted some points that will help you improve your project.
Organise the project structure well
assets
while it's a convention that the assets folder always contains files like images, SVGs, and other static assets. Please create a folder calledmodules
at the root level of the project repo and then add your js module files there__tests__
and other js files apart.Preserving immutability of objects (eg: Arrays)
methood.js
file, I have seen that in order to add a new task in the tasks array, you used the push method of the array object. While there is no significant problem with it, this method mutates(changes) the original array by adding a new item. Modern development encourages using ways that don't mutate the original object but rather use a copy of it. So the best option, in that case, is using the Higher order functionConcat()
which is called on the array, It creates a copy of that array, adds new items and then returns that copy ๐ ๐ So please use it instead ๐I hope this is helpful to you
Cheers and happy coding ๐