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

fix(signals): export DeepSignal #4377

Merged
merged 2 commits into from
Jun 10, 2024
Merged

fix(signals): export DeepSignal #4377

merged 2 commits into from
Jun 10, 2024

Conversation

timdeschryver
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #4372

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Copy link

netlify bot commented Jun 6, 2024

Deploy Preview for ngrx-io canceled.

Name Link
🔨 Latest commit 6536c3a
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/6662b7a80c615100080d20e2

@brandonroberts brandonroberts merged commit fa26c5c into main Jun 10, 2024
5 checks passed
@brandonroberts brandonroberts deleted the export-deepsignal branch June 10, 2024 00:36
@matheo
Copy link

matheo commented Sep 23, 2024

@timdeschryver is it possible to export toDeepSignal too?
other open source libraries can take advantage of it without duplicating it :(

@rainerhahnekamp
Copy link
Contributor

@matheo, is signalState() not already the toDeepSignal you are looking for?

@matheo
Copy link

matheo commented Sep 23, 2024

@rainerhahnekamp thanks for the answer!
the requirement is to convert and keep track of a changing snapshot:
niklas-wortmann/xstate-angular#13
so every time the state-machine is updated, we get a refreshed DeepSignal like here:
https://github.com/niklas-wortmann/xstate-angular/blob/main/lib/xstate-ngx/src/lib/useSelector.ts

it doesn't fit quite well right? we need to support primitive data types and not only objects
as we can select single-values of the context (the only object), or the value/error/output of the state-machine, etc.

@timdeschryver
Copy link
Member Author

@matheo will you be installing the @ngrx/signals package just to have the toDeepSignal method available?

I think it would be better to create a new issue with this request and explain the need why it will be useful to also export toDeepSignal. We try to keep our public API to a minimum to make it easier to change in the future without introducing breaking changes.

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.

[Bug] @ngrx/signals: DeepSignal is not exported
5 participants