Fork me on GitHub
#missionary
<
2021-07-21
>
martinklepsch14:07:44

Hey! I’m considering a bunch of options for working with “streams of document updates” in ClojureScript. RxJS/beicon, maybe plain JS, and then also missionary. Are there any reasons why you would suggest not to use missionary?

martinklepsch14:07:59

Also curious if you know of any other people using this from ClojureScript

martinklepsch14:07:14

also just practically: I have a subscribe function that expects an on-value callback. Could someone help me understand how to transform this into a missionary flow?

leonoel14:07:07

if you're familiar with RxJS, the learning curve should be smooth. to interop with callback-based apis, use observe

leonoel14:07:39

missionary is partly born out of my frustrations with Rx, it aims to be strictly more powerful and I'm not aware of any use case that is not covered yet

martinklepsch15:07:46

@leonoel thanks! do you have an example for using observe somewhere? I’m not sure I get it by just reading the docstring haha

leonoel15:07:55

(m/observe
  (fn [!]
    (.addEventListener js/window "click" !)
    #(.removeEventListener js/window "click" !)))

martinklepsch17:07:06

neat, that looks easy 🙂

martinklepsch17:07:39

FWIW I think something like this would be a great example in the docs 🙂

martinklepsch22:07:06

So another question 🙂 Extending on the above example: how would I consume items from the flow until a condition is matched? E.g. the event target is a specific one.

leonoel22:07:52

m/eduction with take-while

martinklepsch23:07:54

Uhh, that’s nice