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

feat: improve sverdle reactivity #10670

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

oliv37
Copy link
Contributor

@oliv37 oliv37 commented Sep 1, 2023

The code responsible for computing classnames and description objects

$: {
  classnames = {};
  description = {};
    
  data.answers.forEach((answer, i) => {
    ...
} 

is executed every time the data variable is updated, (i.e. when the player types a letter).

This code needs to be executed only when a new answer is added to the game.
I created a variable currentGuess to store the letters of the current row, this prevent from updating the data object constantly.

This PR also fix this bug :

  • It's possible to submit the form by pressing the Enter key even if there is less than five letters on the current row.

@changeset-bot
Copy link

changeset-bot bot commented Sep 1, 2023

🦋 Changeset detected

Latest commit: 52bca1a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benmccann benmccann merged commit e8ca182 into sveltejs:master Sep 21, 2023
11 of 13 checks passed
@github-actions github-actions bot mentioned this pull request Sep 21, 2023
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.

2 participants