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

Feature Request: Create injection token to replace "NgRx SignalStore" when calling connect #149

Closed
mrentmeister-tt opened this issue Feb 18, 2025 · 9 comments · Fixed by #151
Labels
enhancement New feature or request

Comments

@mrentmeister-tt
Copy link

I would like to have the ability to configure the name of the application that appears in the Redux DevTools extension ("NgRx SignalStore"). Currently there isn't a way to change the name of the application after window.__REDUX_DEVTOOLS_EXTENSION__.connect is called. Since the DevtoolsSyncer already is an injectable service, please create an injection token that can be used to modify the app name when calling connect.

Example:

export const NGRX_DEVTOOLS_APPLICATION = new InjectionToken<string>('NgRxDevtoolsApplication');
@rainerhahnekamp
Copy link
Collaborator

Yes, we can do it via injection token, but we could also extend to withDevtools('flights', {devtoolsName: 'SignalStore'}). What is better?

@mrentmeister-tt
Copy link
Author

I think I would prefer to do an injection token, so that you set it when you bootstrap your application. As far as I understand it, withDevtools defines a feature slice, rather than configuring the whole application. If put within withDevtools, what would happen if you have 2 conflicting devtoolsName passed by different stores?

@mrentmeister-tt
Copy link
Author

Another option would be creating a function called something like provideDevtoolsConfig, that could be called when creating an application. It would be similar to https://ngrx.io/guide/store-devtools, and would allow you to set the name as part of the config.

@rainerhahnekamp
Copy link
Collaborator

Yes, so if it is going to be global, it should work via the provide* function

@rainerhahnekamp
Copy link
Collaborator

@mrentmeister-tt do you want to implement it?

@rainerhahnekamp rainerhahnekamp added the enhancement New feature or request label Feb 19, 2025
@mikerentmeister
Copy link
Contributor

switched to my other GH account, but yes, I will take a stab at a PR. I'll plan on implementing a provideDevtoolsConfig function, unless you'd rather I call it something else?

@mikerentmeister
Copy link
Contributor

@rainerhahnekamp - I have finished the code for this feature. Can you please add this user as a collaborator so that I can publish the branch? Thanks!

Image

@rainerhahnekamp
Copy link
Collaborator

Hey @mikerentmeister, at GitHub you usually fork this project to your own account and publish the branch there. GitHub is smart enough to to see that your forked repo has a new branch and offers you to create a PR right here. It is very easy.

So forking and pushing to your own repository, you navigate here https://github.com/angular-architects/ngrx-toolkit and GitHub asks you immediately if it should create the PR

mikerentmeister added a commit to mikerentmeister/ngrx-toolkit that referenced this issue Feb 20, 2025
…toolsConfig to configure redux devtools
@mikerentmeister
Copy link
Contributor

@rainerhahnekamp - Thanks! PR submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants