Skip to content

GetState interface #18

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
AngusMorton opened this issue Jun 2, 2017 · 0 comments
Open

GetState interface #18

AngusMorton opened this issue Jun 2, 2017 · 0 comments

Comments

@AngusMorton
Copy link

AngusMorton commented Jun 2, 2017

A GetState interface would allow us to hide the Store type when using it in situations that shouldn't have access to the Store methods.

This is relevant for cases where you don't want the consumer to be able to do operations on the Store. e.g. redux-observable where the Epic should not have access to the Store because that would allow the Epic to dispatch actions manually, which would be an error.

It would probably look something like:

interface GetState<S> {
   S getState();
}

The Store<S> would implement the GetState interface.

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

1 participant