yogthos/memory-hole

event handlers are not pure

Offen

#22 geöffnet am 29.10.2016

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Clojure (25 Forks)github user discovery
enhancementhelp wanted

Repository-Metriken

Stars
 (264 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Contributor Guide