Skip to content

Conversation

@simon-lund
Copy link
Contributor

use const for key variable and assign it a symbol instead of empty of object.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset).

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

use `const` for key variable and assign it a symbol instead of empty of object.
@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2025

⚠️ No Changeset found

Latest commit: d942326

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@svelte-docs-bot
Copy link

@Rich-Harris
Copy link
Member

Thanks but there's no real benefit to using a symbol here, it just makes it look like you're supposed to use one when in reality any value will do; as such I think it adds confusion

@Rich-Harris Rich-Harris merged commit 6a668c4 into sveltejs:main Apr 7, 2025
@simon-lund
Copy link
Contributor Author

simon-lund commented Apr 7, 2025

I see your point, I was just confused by the key variable being an empty object. I guess someone will always be confused, so yea no need to update it. Maybe if this is a common thing to do, one could add a comment, because initially I thought this was an error in the docs as I did not expect this to work 😅

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