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

docs: use a canvas demo for $effect #10745

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

docs: use a canvas demo for $effect #10745

wants to merge 3 commits into from

Conversation

Rich-Harris
Copy link
Member

Reviewing the $effect docs in light of #10740, I think we can make a few improvements. Submitting them as separate PRs so they can be discussed independently.

The examples we use provide framing for how constructs are supposed to be used. I think we've been making a mistake, therefore, by using console.log in $effect examples when $inspect is a better tool for the job.

The current example is rather confusing in other ways:

  • the button that changes count contains {double} (mea culpa)
  • it says that the effect won't re-run when double changes because it's read inside a setTimeout, but it will re-run when double changes because it re-runs when count changes, and double changes when count changes

Copy link

changeset-bot bot commented Mar 10, 2024

⚠️ No Changeset found

Latest commit: a755d95

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

@leoj3n
Copy link

leoj3n commented Mar 11, 2024

I tried both demos and they work. Far more understandable and more fun too.

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Yeah this reads better, have some suggestions though.

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

3 participants