Closed ryanmitts closed 5 years ago
Merging #112 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #112 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 3 3
Branches 1 1
=====================================
Hits 3 3
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 98de5fe...dbabc94. Read the comment docs.
@ryanmitts thank you for the PR. I apologize for not getting back to you sooner, and now that #114 is also suggested, I would love to have a discussion there about what would be best. I do like the testing strategy that @couven92 came up with, do you think something similar would be possible here?
@JaKXz I would just use the other PR to solve this problem -- I didn't know you could override the optional properties like that.
@ryanmitts great, thanks!
The issue I am having with the type definitions in this package are that the
payload
andmeta
properties on actions are marked optional.When I define my own actions and extend the types using this package -- I know that some of my actions will and must always have a
payload
ormeta
property set.With my TypeScipt compiler using the
--strictNullChecks
errors will be thrown when you try to access thepayload
ormeta
values as they could be undefined given the current definition of an FSA.The work around would be to always do an
if
check to see if the properties are defined.This is not very nice in your code.
I have proposed new definitions where you can specify and an FSA has a
payload
and/ormeta
property.This has been documented in issue #109 .
This also fixes a small bug with the newer minor versions of Jest as documented in the commit message for that fix.