Skip to content

chore: refactor signal types #10698

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

Merged
merged 11 commits into from
Mar 5, 2024
Merged

chore: refactor signal types #10698

merged 11 commits into from
Mar 5, 2024

Conversation

Rich-Harris
Copy link
Member

Another piece of #10594. While working on that PR I found it made a huge difference to update the various signal types:

  • use interface instead of type (interface is less forgiving)
  • rename SourceSignal to Source, etc
  • make Derived extend Source, rather than deriveds sharing a type with effects, since they have much more in common with each other
  • have a Value type which is a union of Source and Derived, and a Reaction type which is a union of Derived and Effect
  • avoid using the Signal type (which is a union of all three) unless necessary

There's more to do still (renaming some variables, replacing the one character signal.x style properties with something a bit less cryptic, getting rid of unused Derived properties) but that can happen in follow-up PRs.

Copy link

changeset-bot bot commented Mar 5, 2024

⚠️ No Changeset found

Latest commit: 95a348c

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

@dummdidumm dummdidumm merged commit 86f3265 into main Mar 5, 2024
@dummdidumm dummdidumm deleted the signal-types branch March 5, 2024 12:15
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.

3 participants