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

event handlers are not pure #22

Open
mozinator opened this issue Oct 29, 2016 · 1 comment
Open

event handlers are not pure #22

mozinator opened this issue Oct 29, 2016 · 1 comment

Comments

@mozinator
Copy link

Event handlers in re-frame should be pure.
In the handlers there are side effects created by calling ajax functions.

https://github.com/yogthos/memory-hole/blob/master/src/cljs/memory_hole/handlers/admin.cljs#L15

The re-frame / pure way would be to write an effect handler which handles the execution of the state change.
Have a look at the following library to see how this can be solved in a pure way:

https://github.com/Day8/re-frame-http-fx

@yogthos
Copy link
Owner

yogthos commented Oct 29, 2016

Yeah I keep meaning to switch to using those, just haven't had a chance to get around to it. If you're up for doing a PR that would be much appreciated though. :)

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

No branches or pull requests

2 participants