yogthos/memory-hole

event handlers are not pure

開放

#22 建立於 2016年10月29日

 (1 則留言) (0 個反應) (0 位負責人)Clojure (25 個分叉)github user discovery
enhancementhelp wanted

倉庫指標

星標
 (264 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南