Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag n drop #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Drag n drop #6

wants to merge 8 commits into from

Conversation

ishpaul777
Copy link
Owner

@ishpaul777 ishpaul777 commented Jul 12, 2022

Best Practices & drag and drop

I implemented Drag and drop feature in this pull request also in this pull request. My coding Partner @hammaazarok reviewed my code.

@@ -56,7 +56,8 @@ export class Store {
const checkbox = el;
const taskList = document.querySelector('.tasks');
const tasks = Store.getTasks();
const nodes = Array.prototype.slice.call(taskList.children);
const nodes =Array.prototype.slice.call(taskList.children);;
console.log(nodes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly remove the console.log to follow the best practices

@@ -56,7 +56,8 @@ export class Store {
const checkbox = el;
const taskList = document.querySelector('.tasks');
const tasks = Store.getTasks();
const nodes = Array.prototype.slice.call(taskList.children);
const nodes =Array.prototype.slice.call(taskList.children);;
console.log(nodes)
for (let i = 0; i < tasks.length; i += 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using (.forEach(), .map(), .filter(), .reduce() and .find()) functions instead of (for loop) for better clean code .

@@ -56,7 +56,8 @@ export class Store {
const checkbox = el;
const taskList = document.querySelector('.tasks');
const tasks = Store.getTasks();
const nodes = Array.prototype.slice.call(taskList.children);
const nodes =Array.prototype.slice.call(taskList.children);;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spread operator can be used to make the code cleaner instead of Array.prototype.slice.call(taskList.children);

Copy link
Collaborator

@hammaazarok hammaazarok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ishpaul777 ,

Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!

Required Changes ♻️
See the inline comments above

Cheers and Happy coding!👏👏👏

Copy link
Collaborator

@hammaazarok hammaazarok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ishpaul777 ,

100

Your project is complete! There is nothing else to say other than... it's time to merge it 👍
Congratulations! 🎆

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants