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

feat(store): add dispatch utility #2143

Merged
merged 2 commits into from
Mar 28, 2024
Merged

feat(store): add dispatch utility #2143

merged 2 commits into from
Mar 28, 2024

Conversation

arturovt
Copy link
Member

No description provided.

Copy link

nx-cloud bot commented Mar 25, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1c7a57e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

Copy link

bundlemon bot commented Mar 25, 2024

BundleMon (Integration Projects)

Unchanged files (2)
Status Path Size Limits
Main bundles(Gzip)
hello-world-ng17/dist-integration/main.(hash)
.js
68.48KB +1%
Main bundles(Gzip)
hello-world-ng16/dist-integration/main.(hash)
.js
67.03KB +1%

Total files change -9B -0.01%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@markwhitfeld
Copy link
Member

I think we should include the dispatch utility in the @ngxs/signals package so that it is grouped together with the other utilities that follow the "signals style".
It is also easier to move something into the main package at a later stage, than it out of it.
What do you think?

@arturovt
Copy link
Member Author

I thought similarly, believing it should be a part of the signals package, mainly because those utilities are quite similar.

@ngxs ngxs deleted a comment from codeclimate bot Mar 27, 2024
@ngxs ngxs deleted a comment from codeclimate bot Mar 27, 2024
@profanis
Copy link
Contributor

I think we should include the dispatch utility in the @ngxs/signals package so that it is grouped together with the other utilities that follow the "signals style". It is also easier to move something into the main package at a later stage, than it out of it. What do you think?

Although it makes sense to have select and dispatch under the same package, I feel that the dispatch should be part of the core.
I am thinking of a case where a consumer is not yet about to move to signals but would love to use the dispatch utility function. Having an import like this import { dispatch } from @ngxs/signals could confuse.

@markwhitfeld
Copy link
Member

I think we should include the dispatch utility in the @ngxs/signals package so that it is grouped together with the other utilities that follow the "signals style". It is also easier to move something into the main package at a later stage, than it out of it. What do you think?

Although it makes sense to have select and dispatch under the same package, I feel that the dispatch should be part of the core.
I am thinking of a case where a consumer is not yet about to move to signals but would love to use the dispatch utility function. Having an import like this import { dispatch } from @ngxs/signals could confuse.

Good point @profanis. What would you propose as the ideal split of APIs to packages here?

@rhutchison
Copy link
Contributor

rhutchison commented Mar 27, 2024

you could move select to @ngxs/store and keep the @ngxs/signals library as the interop for @ngrx/signals.

select and dispatch can be used without needing @ngxs/signals. You only really need @ngxs/signals if you want to use signalStore.

@profanis
Copy link
Contributor

you could move select to @ngxs/store and keep the @ngxs/signals library as the interop for @ngrx/signals.

select and dispatch can be used without needing @ngxs/signals. You only really need @ngxs/signals if you want to use signalStore.

I like that!

@markwhitfeld
Copy link
Member

I see these utilities as generally useful, and not specific to ngrx signal store though.
Keeping them all together in the signals package advocates for a specific style of declaration, to which they are all consistent.

@rhutchison
Copy link
Contributor

I see these utilities as generally useful, and not specific to ngrx signal store though. Keeping them all together in the signals package advocates for a specific style of declaration, to which they are all consistent.

What is your recommendation?

@ngxs ngxs deleted a comment from codeclimate bot Mar 28, 2024
@arturovt arturovt marked this pull request as ready for review March 28, 2024 12:54
@arturovt arturovt merged commit ee0f5f5 into master Mar 28, 2024
13 checks passed
@arturovt arturovt deleted the feat/dispatch branch March 28, 2024 12:54
@arturovt
Copy link
Member Author

Merged. Can revert if we agree to do this.

Copy link
Member

@markwhitfeld markwhitfeld left a comment

Choose a reason for hiding this comment

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

I'm happy for all of this to move to the @ngxs/store package.
I think it makes more sense to all be core.

@markwhitfeld markwhitfeld added this to the v.18.0.0 milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants