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

Add ability to set default meta object for the action creator in definition #4

Open
Pushplaybang opened this issue Feb 24, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@Pushplaybang
Copy link
Contributor

Motivation

while it might often be the case that we want to add some meta to action at the point of invocation, the meta object is also useful when working with libraries such as redux-offline, that requires the meta object to contain specific fields. defining this each time an action is invoked, would suck

Initial Proposals

1: add a meta-option as an additional argument to the main function, that accepts an object defining meta for each action that requires it.

2: optionally parse an object instead of a function in the definition, if this is an object, we would expect a update key with the function to be used in the reducer (required), and a meta key, that would contain an object that would be parsed into the actionCreator function, setting this as the default meta.

I'm leaning towards option two, as this would allow for other options to parsed to a specific action /actioncreator/reducer update function all within the single definition object.

@Pushplaybang Pushplaybang added the enhancement New feature or request label Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant