Fork me on GitHub
#untangled
<
2016-12-23
>
currentoor00:12:58

hahaha! 😂

fragamus06:12:46

I noticed in project.clj that the module name seems wrong... untangled/demo:1.0.0 instead of untangled/paginate-large-lists:1.0.0

Ian Chow07:12:36

@fragamus are you running 2 repls - for client and server? the cookbook recipes are full stack.

Ian Chow07:12:15

looks like doing a df/load with post-mutation from within componentDidMount results in an infinite loop. i would like to load some data when a page becomes visible / mounted, then use post-mutation to process that data. what would be the right way to do this?

mitchelkuijpers08:12:44

@ianchow you should refrain from using component lifecycles for this

mitchelkuijpers08:12:13

You should try to fire loads from actions

mitchelkuijpers08:12:20

But I did the exact same thing when I started with untanged

mitchelkuijpers08:12:46

But if you want to load data for a page then you probably have a router or something right? That would be good place to fire loads from

Ian Chow08:12:22

@mitchelkuijpers thanks. yeah solved it by simple putting the df/loads somewhere else.

fragamus11:12:49

@lanchow Yes I am running 2 repls, backend and frontend as I have done for several other recipes.

Ian Chow16:12:42

@fragamus just cloned and ran it, works fine.

fragamus16:12:36

@ianchow are you using intellij?

Ian Chow16:12:22

@fragamus nope, spacemacs.

Ian Chow16:12:41

have you tried (reset-autobuild) on figwheel?

fragamus16:12:17

I just tried but it gave the same error shown above.

fragamus16:12:26

To be clear, I used (reset-autobuild) on figwheel, and that looked ok, but the app failed as shown above.

tony.kay17:12:24

@ianchow I don't recommend tying IO to component lifecycle. The proper way is: - Do a mutation (which you know to cause something to happen in the UI). From within that mutation, you can compose in a load-action

tony.kay17:12:18

The thing to note is that nothing changes on the UI without some event. Initial loads go in started-callback. Other loads go via user events, which trigger mutations.

tony.kay17:12:24

Never put the logic in the UI

tony.kay17:12:02

or else you lose the pure nature of your UI and end up with nightmares like IO happening because React decided to unmount/mount your component for some reason (related to vdom diff)

tony.kay17:12:38

@fragamus Did you mess with versions of things? lein deps :tree might warn you of conflicts. Anything in your lein user profile that might be pulling in alt versions of things?

tony.kay17:12:04

e.g. did you put lein-figwheel in your user profile or something

tony.kay17:12:19

it's complaining about things being missing that are part of compiler.

tony.kay17:12:29

so, not a code problem with the recipe. It's your env