-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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(core): add toString implementation to signals #54002
Conversation
Isn't this method a great use for the dev tools feature where we can see the Signals graph? |
I'm not sure if it's worth shipping the extra code for traversing the graph, given that the same information can be displayed better in the dev tools. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But now we've got also query signals so you might want to include those as well - or I can do it in the follow-up PR.
Since signals are function, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static `toString` function to address the issue. **Note:** it's tempting to have `toString` output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead.
35dcd35
to
1eeee66
Compare
Updated with a |
This PR was merged into the repository by commit 656bc28. |
Follow-up to angular#54002 that: * Remove the `toString` implementation from the `primitives`. * Guards the `toString` with `ngDevMode` and prints out the value.
Since signals are function, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static `toString` function to address the issue. **Note:** it's tempting to have `toString` output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead. PR Close angular#54002
Since signals are function, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static `toString` function to address the issue. **Note:** it's tempting to have `toString` output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead. PR Close angular#54002
Follow-up to angular#54002 that: * Remove the `toString` implementation from the `primitives`. * Guards the `toString` with `ngDevMode` and prints out the value. PR Close angular#54079
Since signals are function, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static `toString` function to address the issue. **Note:** it's tempting to have `toString` output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead. PR Close angular#54002
Follow-up to angular#54002 that: * Remove the `toString` implementation from the `primitives`. * Guards the `toString` with `ngDevMode` and prints out the value. PR Close angular#54079
Since signals are function, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static `toString` function to address the issue. **Note:** it's tempting to have `toString` output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead. PR Close angular#54002
Follow-up to angular#54002 that: * Remove the `toString` implementation from the `primitives`. * Guards the `toString` with `ngDevMode` and prints out the value. PR Close angular#54079
Since signals are function, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static `toString` function to address the issue. **Note:** it's tempting to have `toString` output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead. PR Close angular#54002
Follow-up to angular#54002 that: * Remove the `toString` implementation from the `primitives`. * Guards the `toString` with `ngDevMode` and prints out the value. PR Close angular#54079
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Since signals are functions, currently stringifying them reveals the implementation of the function. This can lead to confusion since it contains internal implementation details. These changes add static
toString
function to address the issue.Note: it's tempting to have
toString
output the actual value of the signal, but that would encourage users not to call the function which will be problematic in the long run. That's why these changes are using a static string instead.