Skip to content

should createAction be able to accept a payloadCreator function as a second argument? #95

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

Closed
aholachek opened this issue Jan 24, 2019 · 3 comments

Comments

@aholachek
Copy link
Contributor

In the redux-actions library's version of createAction, you can provide an optional second argument, a payloadCreator function. In the past, I've used it for things like generating a unique id for a new item before passing it along. (I don't know if that is best practice though).

Is adding the payloadCreator argument to your version of createAction something you would consider?

@aholachek aholachek changed the title should createAction be able to accept a payloadCreator function as a second argument? should createAction be able to accept a payloadCreator function as a second argument? Jan 24, 2019
@markerikson
Copy link
Collaborator

Yeah, it's absolutely something I'd like to consider - there's been a few other issues related to this topic. It just hasn't been a high enough priority.

@aholachek
Copy link
Contributor Author

Ah, got it, thanks (I didn't look very hard for previous issues about this). I'll close this. Thanks very much for making this library, it's going to be so nice to have a centralized place for these useful patterns.

@markerikson
Copy link
Collaborator

Sure. Yeah, there's dozens (hundreds?) of similar libs out there already, but the goals are are to have one that's "official", and also integrates some other niceties.

Tell you what, leave a comment over in #91 regarding this.

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

No branches or pull requests

2 participants