Fork me on GitHub
#datascript
<
2019-10-24
>
Quest22:10:05

For anyone using Datascript on the frontend: added tuple values & pull-many to posh "0.5.7" & re-posh "0.3.1". Thanks to denistakeda for taking over Posh maintenance & cutting these releases. https://github.com/denistakeda/posh https://github.com/denistakeda/re-posh

20
Drew Verlee19:10:28

Thats great. I'm going to try and evaluate a small project using re-posh. At the same time as fulcro. Re-posh has the same interaction with react's framework as re-frame right?

Quest00:10:12

@U0DJ4T5U1 Can you clarify the question? (Re-posh doesn't interact with re-frame directly. It just provides the "re-frame wiring" over Posh & re-frame. Posh is the underlying library provides the "reactive atoms" over Datascript. Re-frame is the only piece that touches react [through its own dependency, Reagent.])

Drew Verlee00:10:10

I see, I temporarily forgot that reframe has nothing to do with react really. So my question was confusing in two ways. I suppose im curious how the reactive atoms are built.

Quest01:10:17

I don't think I could give a satisfactory answer on that, as there's quite a bit of magic going on there still for me. I did a bit of digging though: Posh references reagent.ratom/make-reaction. https://github.com/denistakeda/posh/blob/master/src/posh/reagent.cljc#L21 Posh's own usage of make-reaction: https://github.com/mpdairy/posh/blob/413337f07a564fa35c731b8d00d5cf511cd6609c/src/posh/plugin_base.cljc#L90 Reagent writeup on how reactions work: https://github.com/reagent-project/reagent/blob/d28b16e11d7f3500e490563f1ea0a615354b5478/doc/ManagingState.md#reactions Code definition of make-reaction: https://github.com/reagent-project/reagent/blob/88e9833be9c3135548d760286ffd84d88a0a0489/src/reagent/ratom.cljs#L512

Quest01:10:37

Exactly how Posh applies the usage of make-reaction isn't clear to me, though you can see that it uses it to deregister tracking some queries whenever a reaction is disposed