Fork me on GitHub
#reagent
<
2017-04-11
>
pesterhazy07:04:07

@jfntn can you give some context? What's the benefit of using transducers on ratoms?

jfntn13:04:06

@pesterhazy was just trying to see if it'd work'

noisesmith16:04:40

what about making an async transduction on an iterator based on add-watch?

mikerod16:04:22

does anyone know or have any experience with any good libraries for creating editable flowcharts using reagent?

mikerod16:04:58

Preferably it’d be reagent oriented, but a React lib could do too. I was wanting to target <svg>, but I’m guessing that’d be the most likely candidate for a React based lib anyways.

mikerod16:04:13

I seem to have some trouble trying to find any solid details on this via my searches

jfntn19:04:05

@noisesmith not sure I understand what the benefits would be?

noisesmith19:04:54

probably not useful in this case, but I can see cases where I’ve used add-watch in non-reagent code that would have been more convenient as a transducer across modifications

jfntn19:04:52

The snippet above seems to work, but I don’t think this will play well with stateful transducers, it never calls the 1-arity of the rf so for some kinds of transducers that do aggregation it probably would never return a value

jfntn19:04:14

Not sure if there’s a good solution to interop, since the semantics are pretty different

noisesmith19:04:27

right- but those aren’t valid for anything of indeterminate lifetime anyway

jfntn19:04:22

Right they’d produce a value when the coll is finished processing, which would never happen for a ratom, unless :on-dispose passes a final value down? I’ve never used that

noisesmith19:04:17

I could see it working if you had an intermediate object to transduce on, with a disconnect method - then it’s up to your code to decide when wrapping up the stateful transducers and finalizing a result is apropriate

noisesmith19:04:12

perhaps taking the reaction or watch and deriving an iterator from that, and the transducing on the iterator, closing the iterator if/when apropriate

jfntn19:04:07

interesting!