Closed Arelav closed 6 years ago
I think this should get merged! Clearly with the number of times this has come up, TypeScript users are generally confused that the type definitions do not match the documentation. If a property is truly optional, like meta
, it should be defined with a question mark meta?:
so we aren't littering our actions with
{
type: 'foo',
meta: null,
}
Incidentally, DefinitelyTyped has always had this right.
By the way, we should technically be doing the same for payload as well...
I agree, we should merge this and do the same for payload
Sorry for the delay in getting this merged! I will have a patch released with teh fix for payload as well today.
+ flux-standard-action@2.0.3
published! Thank you for your patience everyone.
I'm providing with pull request a little example how it can be used with action creators. Because in current implementation action creator must return 'meta' explicit.
Link to Typescript playground%3B)