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

signalState is not creating DeepSignal property signals when the value object is an instance of a class #4604

Open
2 tasks
vtachkov opened this issue Nov 22, 2024 · 1 comment · May be fixed by #4605
Open
2 tasks

Comments

@vtachkov
Copy link

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

signals

Minimal reproduction of the bug/regression with instructions

Using signalState, create a new store where the type of the value in the store is a class, and the value is set to an instance of that class. The documentation states that when the value in the store is an object, signals will be created for each property on the object (DeepSignal). But in the case where the object is a class instance, signals are not being created for each property, they are undefined.

If this isn't supported, that's one thing, but TypeScript still types each property on the value as a signal.

Minimal reproduction: https://stackblitz.com/edit/typescript-dxfawb?file=index.ts

Expected behavior

Signals are created for each property on the signalStore value when the value is an instance of a class.

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

NgRx: 18+

Other information

No response

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

  • Yes
  • No
@rainerhahnekamp
Copy link
Contributor

Hi @vtachkov, I haven’t found a solution yet. I’ve shared my PR with the experiments I’ve tried so far. If you or anyone else discovers a solution, your input would be greatly appreciated!

@rainerhahnekamp rainerhahnekamp removed their assignment Nov 22, 2024
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