domino-clj

mafcocinco 2019-11-07T01:03:00.024400Z

@yogthos want me to take a stab at a function to generate all paths that would need to fire from a given transaction?

yogthos 2019-11-07T02:02:24.025300Z

Yeah it sounds reasonable to me, @scot-brown thoughts?

Scot 2019-11-07T02:54:32.031200Z

While the transformation of the changeset would work as expected in your example, I would rather handle the triggered paths without transforming the transaction. It should just be a pure function from the changeset to the modified paths, which is then used by the effects.

mafcocinco 2019-11-07T04:15:33.031400Z

And events.

mafcocinco 2019-11-07T04:17:37.032300Z

But, yes. Only need the modified paths.

yogthos 2019-11-07T14:18:51.000800Z

@mafcocinco I've added the pre/post functionality on the dev branch, here's what it looks like https://github.com/domino-clj/domino/blob/dev/test/domino/core_test.cljc#L109

yogthos 2019-11-07T14:19:24.001500Z

ended up going with ring middleware style for now, but we can play around with it if anybody has better ideas

yogthos 2019-11-07T14:20:42.003Z

the pre/post functions are closures that accept the event handler as their argument, and the inner pre function matches the handler arity accepting the context, inputs, and outputs while the post function simply accepts the result returned by the handler

yogthos 2019-11-07T14:21:59.004400Z

it seems pretty flexible since the wrapper has access to all the information the handler has, and it can short circuit by returning a nil, since a nil return from an event handler is treated as no change

yogthos 2019-11-07T14:22:22.004900Z

also made sure that pre/post conditions attached to parent path segments are considered

mafcocinco 2019-11-07T15:15:27.005100Z

:thumbsup_all:

mafcocinco 2019-11-07T18:09:04.006200Z

@yogthos do you envision the pre and post handlers being the entry point for validation (`spec` or whatever) or do you think validation will be a more fundamental/explicit piece of the schema?

yogthos 2019-11-07T18:12:19.008200Z

I was talking to Tommi to see if we could use malli to generate the schema, so that's one potential approach, but attaching validation to pre/post handlers seems like a good approach as well

yogthos 2019-11-07T18:12:42.009Z

I don't think we'd want to be too opinionated here, and just highlight different options

mafcocinco 2019-11-07T18:20:08.009200Z

agreed.

mafcocinco 2019-11-07T18:20:22.009600Z

mostly just provide the mechanism(s) by which validation could be injected.

mafcocinco 2019-11-07T18:21:01.010500Z

On a related note, I'm almost finished with changes to work related software that depends on 0.2.0 of domino. Do you have an ETA on pushing to Clojars?

nikp 2019-11-07T20:19:55.011300Z

Pretty soon -- we just need to update the docs. Hopefully tonight if I find time, if not, within next few days

mafcocinco 2019-11-07T20:51:27.011900Z

Sounds good. Let me know if I can help. Would like to deploy with 0.2.0 dependency tomorrow.

nikp 2019-11-07T20:56:31.012100Z

:thumbsup:

yogthos 2019-11-07T20:59:26.012800Z

I can push out a new version to clojars tonight, and we can update the docs this week

mafcocinco 2019-11-07T21:55:01.013Z

thanks!

nikp 2019-11-07T22:06:18.013200Z

0.2.0 is up on clojars 🙂