Closed chmaltsp closed 6 years ago
@chmaltsp Thanks for reporting. I apologise as I forgot this syntax will cause a problem with "strictNullChecks". The reason of using the undefined
type is to take the advantage of the news conditional type, so that for example if the payload is set to 'undefined', the resulting action object would not have a payload field.
I'm working on a fix on it and would make a PR soon.
@alvis Thank you! I was playing around with it a bit more and I also noticed that in a true FSA payload and meta should actually be any
. In my app sometimes the payload is just a string.
@chmaltsp #117 should now resolve the problem.
Also thanks for pointing out the recommended types for payload
and meta
too. I'm working on it.
Thanks to all for reporting and especially for @alvis for the TS fixes. It is published in v0.15.4
@chmaltsp #117 should now resolve the problem.
Also thanks for pointing out the recommended types for
payload
andmeta
too. I'm working on it.
@alvis @jeffbski As the comment above says, typings for payload
and meta
should extend any
, but they still extend object | undefined
.
Hello
Thanks for getting the typescript typings in. Maybe I am doing something wrong, but when using 2.9.2 you cannot extend an object and set the default to
undefined
Setting changing the definition to
helps but then
action.payload
ends up being undefined increateLogic({ process({ action }})
. I'm still kind of new to TS but this prevents the project form building! @alvis maybe you know more about this?