Closed SantoJambit closed 4 years ago
Merging #144 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #144 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 10 10
Lines 56 56
Branches 9 9
=====================================
Hits 56 56
Impacted Files | Coverage Δ | |
---|---|---|
src/create-action-creator.ts | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update d209aba...b997cb5. Read the comment docs.
I'm assuming the deploy fails are not related to my PR.
@SantoJambit Thank you for submitting this PR. Can you add a test case to DTS tests for this PR? It can check for type checker failure on application of arguments to a nullary function (action creator created by createActionCreator
).
Correct me if I'm wrong, but I thought the snapshot already takes care of that:
-exports[`createActionCreator createActionCreator('[Todo] truncate') (type) should match snapshot 1`] = `"(<_T>(...args: any[]) => { type: \\"[Todo] truncate\\"; }) & { type: \\"[Todo] truncate\\"; toString(): \\"[Todo] truncate\\"; }"`;
+exports[`createActionCreator createActionCreator('[Todo] truncate') (type) should match snapshot 1`] = `"ExactActionCreator<\\"[Todo] truncate\\", () => { type: \\"[Todo] truncate\\"; }>"`;
This shows, that the returned function may not receive any args.
I think I get what you want.. you want typescript errors in the dts.spec file. As long as this builds, I can try something.
@thebrodmann hope this is what you wanted.
@thebrodmann anything missing?
Absolutely not. Sorry for the latency. Let's go for the release of this honor.
:tada: This PR is included in version 3.2.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Thanks!
:tada: This PR is included in version 3.2.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I had to create a new type
ExactActionCreator
since theActionCreator
type did not specify TCallable. ModifyingActionCreator
didn't seem viable since it would introduce a breaking change.Not sure about the name of this new type. maybe you have a better idea.