keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
urbank 2017-04-14T20:26:19.889502Z

Hello! I'm unclear when the subscriptions get rerun? Do all subscriptions run on every render?

mihaelkonjevic 2017-04-14T20:34:12.970792Z

@urbank so that part is up to reagent, since keechma is using reagent’s reactions for subscriptions. Here’s an excerpt from http://reagent-project.github.io/news/news060-alpha.html Reactions, i.e cursor called with a function, reagent.ratom/reaction, reagent.ratom/run! and reagent.ratom/make-reaction are now lazy and executed asynchronously. Previously, reactions used to execute immediately whenever the atoms they depended on changed.

mihaelkonjevic 2017-04-14T20:36:05.990219Z

what do you want to achieve?

urbank 2017-04-14T20:48:52.117597Z

Hm, I see. Well I have a big list of components, which are all editable. The parent component has a subscription which fetches the ids of the items, and the child components each have a subscription which returns the entity with that id

urbank 2017-04-14T20:49:35.124685Z

However, when I edit one of the child components, the top level subscription executes, and rerenders the whole thing

urbank 2017-04-14T20:50:13.130841Z

the child components edit themselves via ui/send-command

mihaelkonjevic 2017-04-14T20:50:44.136174Z

ok, so I guess that child component has some kind of “editing” local state?

mihaelkonjevic 2017-04-14T20:51:01.139071Z

which gets overridden on each re-reneder?

mihaelkonjevic 2017-04-14T20:52:45.156899Z

so, I don’t think that the parent component should be re-rendered if the id list is not changed

mihaelkonjevic 2017-04-14T20:53:02.159681Z

is it possible that the child component re-renders when you update the item?

mihaelkonjevic 2017-04-14T20:54:31.174631Z

if you parent subscription returns the list of objects (for instance if you use the entity db collection) then it would re-render - because the item in the list changed

urbank 2017-04-14T20:55:13.181446Z

>if you parent subscription returns the list of objects (for instance if you use the entity db collection) then it would re-render - because the item in the list changed

urbank 2017-04-14T20:55:15.181722Z

right

urbank 2017-04-14T20:55:21.182856Z

I think this is the issue

urbank 2017-04-14T20:55:24.183431Z

silly me

mihaelkonjevic 2017-04-14T20:55:52.188168Z

the easiest way to fix it is to just map over the collection and return ids (map :id entity-db-collection)

urbank 2017-04-14T20:56:13.191394Z

Right, thanks! I'll try that

mihaelkonjevic 2017-04-14T20:56:56.198774Z

no problem. How do you like Keechma so far?

urbank 2017-04-14T21:01:09.241702Z

@mihaelkonjevic It seems very promising! Was mostly concerned about this issue with rerendering, but you cleared that up just now. I like the idea of multiple keechma apps running at the same time, because that's something I've been dealing with lately.

urbank 2017-04-14T21:02:28.255414Z

I also big fan of the idea components declare their dependencies, so that you don't have to deal with long argument lists

mihaelkonjevic 2017-04-14T21:03:16.263225Z

awesome, please reach out if you have any questions, I’m always monitoring this channel 🙂

urbank 2017-04-14T21:04:34.275810Z

Thanks! I'm still evaluating what to use for a big rewrite, and keechma is high on the list 🙂

urbank 2017-04-14T21:05:57.289480Z

Haha, I realized that I mostly just regurgitated what's written on your website. As I test more, I'll try to come up with more useful feedback 🙂

mihaelkonjevic 2017-04-14T21:09:02.317992Z

cool. I’m also working on release of https://github.com/keechma/keechma-toolbox which should provide a lot of convenience stuff for keechma. It’s a lib that’s extracted from our production code, but thorough testing and docs are missing. Here is a very rough draft of the blog post about the pipelines which make working with async actions in controller much easier https://gist.github.com/retro/35ef04d42a6c6265ee140dacdf0777df

mihaelkonjevic 2017-04-14T21:09:46.324591Z

I hope to release it this weekend or early next week, so take that into account when making a decision 😉

urbank 2017-04-14T21:13:13.355867Z

Thanks, will check it out! The decision is not exactly imminent... still a lot of work supporting the current version, so time for more longterm things is a bit short 😉