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

贡献者指南