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

Introduce CombinedProvider to sync actions and stores initialization. #2523

Merged
merged 1 commit into from Jul 25, 2016

Conversation

Projects
None yet
2 participants
@dennisoelkers
Member

dennisoelkers commented Jul 25, 2016

When using separate providers for actions and stores, there is the
possibility that only actions need to be imported in a component. Using
the actions then would have no effect though, if the corresponding store
listening to those actions was not initialized already. So there are
cases where the store is imported in components although it is unused.

This PR introduced the CombinedProvider which syncs actions and store
initializations. It can be used to import stores and actions separately
or combined in a component. Usage of it is shown in the SearchPage
component, which is shorted and more concise due to it. It can be used
as a blueprint for future conversions to using the CombinedProvider, but
usage of Actions/StoreProvider is still possible and benefits from
syncing the imports.

Introduce CombinedProvider to sync actions and stores initialization.
When using separate providers for actions and stores, there is the
possibility that only actions need to be imported in a component. Using
the actions then would have no effect though, if the corresponding store
listening to those actions was not initialized already. So there are
cases where the store is imported in components although it is unused.

This PR introduced the CombinedProvider which syncs actions and store
initializations. It can be used to import stores and actions separately
or combined in a component. Usage of it is shown in the SearchPage
component, which is shorted and more concise due to it. It can be used
as a blueprint for future conversions to using the CombinedProvider, but
usage of Actions/StoreProvider is still possible and benefits from
syncing the imports.

@dennisoelkers dennisoelkers added the web label Jul 25, 2016

@dennisoelkers dennisoelkers added this to the 2.1.0 milestone Jul 25, 2016

@edmundoa edmundoa self-assigned this Jul 25, 2016

@edmundoa

This comment has been minimized.

Member

edmundoa commented Jul 25, 2016

LGTM 👍

@edmundoa edmundoa merged commit d189efd into master Jul 25, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1143 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 629 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@edmundoa edmundoa deleted the consistent-actions-and-store-provision branch Jul 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment