Skip to content

Card feature#12

Open
kunal2812 wants to merge 4 commits intoContriHUB:mainfrom
kunal2812:card-feature
Open

Card feature#12
kunal2812 wants to merge 4 commits intoContriHUB:mainfrom
kunal2812:card-feature

Conversation

@kunal2812
Copy link

Fixes #8

Copy link
Contributor

@dev-lovedeep dev-lovedeep left a comment

Choose a reason for hiding this comment

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

make these changes then i will merge your PR



// To view all cards
function viewAllCards(){
Copy link
Contributor

Choose a reason for hiding this comment

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

showAllCards would be a better name

// To view all cards
function viewAllCards(){
// Cards are made viewable when memoryCounter is greater than 0
if(memoryCounter>0){
Copy link
Contributor

Choose a reason for hiding this comment

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

this check should not be inside the function. To make a function reusable, it should do what its name suggests. Checks should be placed where the function is called.

for ex: if we add a hint button which show the all cards , then we can reuse this function, but if this check is there we cannot reuse it

const interval = setInterval(function(){
if(memoryCounter>0){ // Makes a check on memoryCounter and stops after 5 secs
memoryCounter--;
viewAllCards();
Copy link
Contributor

Choose a reason for hiding this comment

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

this viewAllCards function is called every time until the memory counter is zero, which is not good for performance. Add some conditions so that it do not run unnecessarily

@dev-lovedeep
Copy link
Contributor

@kunal2812 are you working on this issue?

@kunal2812
Copy link
Author

@kunal2812 are you working on this issue?

Sorry sir I was out for a while and didn't have access to my pc co could not make the required changes.

@kunal2812 kunal2812 closed this by deleting the head repository Oct 14, 2022
@dev-lovedeep dev-lovedeep reopened this Oct 31, 2022
Copy link
Contributor

@dev-lovedeep dev-lovedeep left a comment

Choose a reason for hiding this comment

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

need to work on your variable naming , otherwise code was ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

initiallly show cards and then hide

2 participants