Fork me on GitHub
#re-frame
<
2021-07-10
>
mikethompson00:07:25

@lilactown Some Background ... I think this idea originally came via @olivergeorge in this thread. https://github.com/day8/re-frame/issues/639#issuecomment-680500053 Because it seemed like a good idea, Isaac made a first round of changes to re-frame to help accommodate better composition: https://day8.github.io/re-frame/releases/2020/#110-2020-08-24 But: • I never wrote proper docs which is a problem because the decision was to add supportive features and then let improved docs look after the rest of the best practice side of this. • I ultimately decided not to go the whole hog and create a new registration function to specifically support composition (reasoning can be seen in that issue thread)

emccue01:07:25

FWIW, what we are doing more or less came from the (somewhat hidden) docs for :fx and the parallels I saw with elm's Cmds. This is the first time I'm seeing this discussion thread

emccue01:07:29

somewhat tangential, but also a neat thing would be if {:fx nil} were valid. Would eliminate the fx/none we have around paralleling elm's Cmd.none

mikethompson05:07:35

@U3JH98J4R Without checking, I suspect {:fx nil} would work Certainly {:fx []} would work

mikethompson05:07:13

If there is anything we can do to improve experience please create an issue

emccue14:07:41

it does not. nil is not sequential

(if-not (sequential? seq-of-effects)
      (console :error "re-frame: \":fx\" effect expects a seq, but was given " (type seq-of-effects))
      

emccue14:07:57

well it does but with a warning

emccue14:07:07

i'll make an issue

Oliver George01:07:11

I’ll gladly contribute to the conversation but it might take me a day or two… I need to compose my thoughts (pun intended)