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!: make signal.get reactive and add signal.getOnce #151

Merged
merged 8 commits into from
Jan 21, 2025

Conversation

bowheart
Copy link
Collaborator

@bowheart bowheart commented Jan 9, 2025

Description

In keeping with other signals libs, calls to signal.get() should register a dependency on the got signal in reactive contexts (e.g. in atom state factories and atom selector functions). Implement that and add signal.getOnce() for getting a node's value non-reactively. Update all our internal usages of .get accordingly - mostly moving off of .get() 'cause we never want to accidentally add edges in calls to other Zedux functions.

Breaking Change

This is only a breaking change from the latest, beta version (2.0.0-beta.0) where signal.get() was just added and is not reactive.

Issues

#115 (almost resolves! The only things left are the cycle event and making event listeners not prevent destruction)

@bowheart bowheart changed the title Josh/reactive get feat!: make signal.get reactive and add signal.getOnce Jan 9, 2025
@bowheart bowheart added this to the Zedux v2 milestone Jan 9, 2025
@bowheart bowheart merged commit d7d634e into master Jan 21, 2025
2 checks passed
@bowheart bowheart deleted the josh/reactive-get branch January 21, 2025 17:00
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.

1 participant