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

withProps doesn't allow Symbols as keys #4655

Open
1 of 2 tasks
rainerhahnekamp opened this issue Jan 3, 2025 · 1 comment · May be fixed by #4656
Open
1 of 2 tasks

withProps doesn't allow Symbols as keys #4655

rainerhahnekamp opened this issue Jan 3, 2025 · 1 comment · May be fixed by #4656

Comments

@rainerhahnekamp
Copy link
Contributor

Which @ngrx/* package(s) are the source of the bug?

signals

Minimal reproduction of the bug/regression with instructions

signalStore skips any symbols of withProps.

In this example, secret is undefined

const SECRET = Symbol('SECRET');

const Store = signalStore(withProps(() => ({ [SECRET]: 'secret' })));

@Component({
  selector: 'app-root',
  template: `Secret: {{ secret }}`,
  providers: [Store],
})
export class App {
  protected store = inject(Store);
  protected secret = this.store[SECRET];
}

https://stackblitz.com/edit/github-wnvurbbx?file=src%2Fmain.ts

Expected behavior

Symbols should be used as well

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

NgRx 19, Angular 19

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@leomayer
Copy link

Perhaps related:

#4664 (reply in thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants