Skip to content

Add an Action interface #19

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

Open
sygour opened this issue Aug 12, 2017 · 2 comments
Open

Add an Action interface #19

sygour opened this issue Aug 12, 2017 · 2 comments

Comments

@sygour
Copy link

sygour commented Aug 12, 2017

The Reducer, Dispatcher and Middleware handle the Object type.
When using it inside a project it could be a really handy thing to have an interface for marking our actions.
Of course, the interface would be empty.

I can't make a pull request right now, so if someone thinks it's a good idea and wants to do it, feel free!

@AngusMorton
Copy link

AngusMorton commented Aug 12, 2017 via email

@sygour
Copy link
Author

sygour commented Aug 13, 2017

It's not more useful per se but it could be help the API and the use of it to handle purposely declared actions instead of any java object.

I guess in some project with the current API, action classes may be named DoSomethingAction or put in an action package. By forcing the type of the received Object, you can just look up what implements the Action interface and you'd have all your actions.

One personal thought also:
On an purely API level, inputs and outputs of the API should be as much as possible types defined in the API. That way the implementing and using projects can control what comes in and out. But again, this one is a personal thought.

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