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

Make meta optional (default to undefined) #94

Merged
merged 1 commit into from
Jan 17, 2018

Conversation

wub
Copy link
Contributor

@wub wub commented Nov 30, 2017

No description provided.

@coveralls
Copy link

coveralls commented Nov 30, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 786f2c3 on wub:patch-1 into 388ca8f on acdlite:master.

@wub
Copy link
Contributor Author

wub commented Nov 30, 2017

Sorry, not an expert in versioning - what should this be bumped to?

@wub wub mentioned this pull request Nov 30, 2017
Copy link
Contributor

@JaKXz JaKXz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM! don't worry about the versioning :) I'll probably release it as a patch.

Perhaps it would be nice to document the typings in the README? do you think you can take that on as well?

cc @unional in case you have any thoughts.

@unional
Copy link
Contributor

unional commented Nov 30, 2017

@@ -26,26 +26,26 @@ export interface FluxStandardAction<Payload, Meta> {
meta: Meta;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this supposed to be optional?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. That's the whole point. It should not be optional. See #53 and related discussion.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry to butt in here. Just hit this issue and am a bit confused... Currently I have this issue:

const x: FSA<string, undefined> = { type: "foo", payload: "hello" }
Type '{ type: string; payload: string; }' is not assignable to type 'FluxStandardAction<string, undefined>'.
  Property 'meta' is missing in type '{ type: string; payload: string; }'.

So setting the type to undefined does not make the attribute optional.

I think the DefinitelyTyped defs handle this in a more appropriate way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed that here: #53 (comment)

It is debatable on which is a better solution.
I would say when microsoft/TypeScript#12400 (comment) is resolved, we will be just fine.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, makes sense. It's just annoying having to add extra code to satisfy types, but a small price to pay I suppose. :)

@JaKXz JaKXz mentioned this pull request Dec 2, 2017
@JaKXz
Copy link
Contributor

JaKXz commented Dec 19, 2017

Okay so unless anyone is opposed I'm going to merge this and release it as a patch today :)

@JaKXz JaKXz merged commit 93016e9 into redux-utilities:master Jan 17, 2018
@JaKXz
Copy link
Contributor

JaKXz commented Jan 17, 2018

+ flux-standard-action@2.0.1 has been published! sorry for the delay, it completely slipped my mind before.

In related news, #100 would be a prime candidate for another patch like this one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants