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

fix(store): update ActionDef new to return any #2149

Merged
merged 7 commits into from
Mar 30, 2024
Merged

Conversation

arturovt
Copy link
Member

No description provided.

Copy link

nx-cloud bot commented Mar 29, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 73df8f6. 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 29, 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

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.

Looks like this is still a work in progress (given the to do).
What is this PR for?

@arturovt
Copy link
Member Author

I removed TReturn from ActionDef, where it was new (...args: TArgs): TReturn, since it was redundant. By mistake, I changed it to ThisType, thinking it would infer the instance type. I now believe I just need to use any as the return type for new.

@markwhitfeld
Copy link
Member

What is the problem that you are looking to solve by removing the TReturn?
Or was is the motivation for removing it?

@arturovt
Copy link
Member Author

We have code where ofActionDispatched accepts a function parameter declared as shown in the test. Attempting to access result.errorType throws an error. Previously, result was inferred as any in this specific case. The use of TReturn wasn't resolving any issues, so I intend for new() to always return any.

@arturovt arturovt changed the title test(store): add parameterized type test for action operator fix(store): update ActionDef new to return any Mar 29, 2024
@markwhitfeld
Copy link
Member

@arturovt this has regressed from previous type matching capabilities on the action type.
I will add a commit to fix this and demonstrate the capabilities I am referring to.

@markwhitfeld
Copy link
Member

@arturovt I have readded the correct typing and added tests that demonstrate the usages.
Hopefully this compiles, I did this in the github editor so I didn't have the build tooling.

@ngxs ngxs deleted a comment from codeclimate bot Mar 30, 2024
@ngxs ngxs deleted a comment from codeclimate bot Mar 30, 2024
@arturovt arturovt merged commit 91801db into master Mar 30, 2024
12 checks passed
@arturovt arturovt deleted the test/parameterized branch March 30, 2024 14:12
@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