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

easily get app-db data in handlers #131

Closed
jiangts opened this issue Nov 6, 2015 · 1 comment
Closed

easily get app-db data in handlers #131

jiangts opened this issue Nov 6, 2015 · 1 comment

Comments

@jiangts
Copy link

jiangts commented Nov 6, 2015

I read in the readme that I shouldn't include subscriptions in my handlers.

However, I find this a nice thing to do for two reasons:

  1. I'm using path middleware in my handlers, and the extra data I want to use in the handler isn't under that path.
  2. subscriptions are a succinct, short way for describing data (instead of having to litter my code with the data path everywhere).

Is there a strong reason to not have subscriptions in my handlers?

@mike-thompson-day8
Copy link
Contributor

@jiangts It is an approach will will corrupt the architecture. It sounds like your path middleware is too narrow. Or that the data should be a part of the event dispatched. Or some other design problem.

See FAQ item #1 - https://github.com/Day8/re-frame/wiki/FAQ#1-why-cant-i-access-subscriptions-from-event-handlers

Also, please note that this is not the place to be asking these questions:
https://github.com/Day8/re-frame/blob/master/CONTRIBUTING.md#support-questions

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