8000 docs: explain `dispatch` utility by arturovt · Pull Request #2153 · ngxs/store · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: explain dispatch utility #2153

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

Merged
merged 3 commits into from
Apr 5, 2024
Merged

docs: explain dispatch utility #2153

merged 3 commits into from
Apr 5, 2024

Conversation

arturovt
Copy link
Member
@arturovt arturovt commented Apr 5, 2024

No description provided.

8000
Copy link
nx-cloud bot commented Apr 5, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 5d4a130. 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 Apr 5, 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%

No change in files bundle size

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Comment on lines 128 to 138
const route = inject(ActivatedRoute);

route.params
.pipe(
map(params => params.invoiceId),
distinctUntilChanged(),
takeUntilDestroyed()
)
.subscribe(invoiceId => {
this.getInvoiceLines(invoiceId);
});
}
< 8000 span class="Button-content"> Copy link
Member
@markwhitfeld markwhitfeld Apr 5, 2024

Choose a reason for hiding this comment

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

A simpler example would be better, so the utility is not lost in all the code.
Potentially:

// An action declared somewhere in your app
class Greet {
  static readonly type = 'Greet';
  constructor ( public greeting: string ) { }
}

// Then, in your component
export class MyComponent {
  greet = dispatch(Greet);

  constructor() {
    // the `this.greet` function has the same signature as the action's constructor!
    this.greet("Hello world!"); 
  }
}

It is good to mention the utility here, but I think it would be good to eventually have a page dedicated to these utilities.

Copy link
codeclimate bot commented Apr 5, 2024

Code Climate has analyzed commit 5d4a130 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 95.2% (0.0% change).

View more on Code Climate.

@markwhitfeld markwhitfeld merged commit d0278c1 into master Apr 5, 2024
@markwhitfeld markwhitfeld deleted the docs/dispatch branch April 5, 2024 21:05
@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.

2 participants
0