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): enable withProps to handle Symbols #4656

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

Conversation

rainerhahnekamp
Copy link
Contributor

Resolve an issue in signalStore that prevented Symbols from being added as property keys when merging
different features.

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?

The value is just undefined.

Closes #4655

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Resolve an issue in `signalStore` that prevented Symbols
from being added as property keys when merging
different features.
Copy link

netlify bot commented Jan 3, 2025

Deploy Preview for ngrx-io canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 9515620
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/679048554d7a8e0008371ccd

modules/signals/spec/with-props.spec.ts Outdated Show resolved Hide resolved
modules/signals/src/signal-store.ts Outdated Show resolved Hide resolved
Following functions support symbols:
- `withState`
- `withMethods`
- `withComputed`
- Slices (`DeepSignal`)
- `deepFreeze`
- override protection
@markostanimirovic markostanimirovic force-pushed the fix/signals/with-props-symbols branch from 315a336 to 9515620 Compare January 22, 2025 01:22
Copy link
Member

@markostanimirovic markostanimirovic left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Btw, I replaced Object.keys with Reflect.ownKeys in withProps as well and added more tests.

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.

withProps doesn't allow Symbols as keys
3 participants