Fork me on GitHub
#re-frame
<
2018-04-23
>
eoliphant02:04:45

HI I’m on the new version of re-frame-10x and i’m having a weird issue where I can’t expand the db views since I upgraded. clicking on the little arrow doens’t seem to work

mikethompson02:04:32

Using the right version of React/Reagent?

mikethompson02:04:09

Other than that ... tried a clean and rebuild?

eoliphant02:04:34

yeah react 16.3.. reagent 0.8.0 etc

eoliphant02:04:38

ok will give that a try

danielcompton02:04:06

What version of 10x?

eoliphant02:04:27

0.3.2-react16

eoliphant02:04:56

the clean and re-build seems to have cleared it up

eoliphant04:04:40

quick question, level 3 subs are the prefered way to do calculations, conversions, etc. and keep components clean. Is there any way to have a level 3 depend on more than one level two? If say I have 2 form cells, and a third that is a sum other 2.

sveri08:04:35

Hi, would it be idiomatic to have the jwt key read from localstorage all the time instead of loading into the app-database on page load and write it everytime it changes to the localstorage?

eoliphant11:04:45

I don’t know if there are idioms per-se. I use the session storage approach to keep it around if the page is loaded, but i only interact with local storage when I first grab it, or after renewing it as you mention you could, but as it’s ‘outside’ the app-db, you should use effects and coeffects for reading and writing it to avoid side-effects. wow, that’s too many effects 😉

sveri13:04:11

Yea, I know about the effects support. I just wonder, both solutions are not ideal in my case, because either requires synchronization with the local-storage. Synchronization in itself is always error prone, thats why I dislike it, but dont see any other way now.

shaun-mahood14:04:34

The new 50 trace limit in re-frame-10x is pretty great - I went a little trace happy and put one in that ran on every item in a sequence - "only showing 50 of 33671 traces" is a lot nicer first run experience than just hanging!

shaun-mahood15:04:35

@sveri: If you need to really ensure you don't have to think about it, you can write your coeffects and effects to do the reading and writing for you as well as your own reg-event-localstorage that wraps your reg-event-* calls with your interceptor.

mikerod16:04:58

@alex-dixon don’t think there is anything in the main lib

mikerod16:04:14

if you follow some of the github issues, you may run across a few impl’s people have

mikerod16:04:55

I think I ended up writing my own debouncing, but was “inspired” by this one. I can’t remember the specifics of why I didn’t use directly (or if I even have a good reason)

sveri16:04:04

@shaun-mahood Thanks for the advice, I'll think about it.

alex-dixon16:04:40

Yarg…ok. Thanks @mikerod

mikerod16:04:06

The good news is I think implementing it is relatively straightforward

alex-dixon16:04:49

Surely for you 🙂 Wish I felt the same was true for me… think it would take me some time. This is for work so I feel like I have none when it comes to things like this especially. Think I’ll go with this: https://github.com/7theta/re-frame-fx

👍 4
sandbags18:04:44

Am I missing something? In the re-frame-template +10x app the initialize db event is defined using fn-traced but when the app runs there doesn't seem to have been event traced, app-db shows nil, not until I send one of my own events does it seem to be recording.

👍 4
sandbags18:04:08

Ok this is odd, but after that event i can go back and there it is

sandbags18:04:55

So when I first run the app I get "Code tracing is not currently available for this event" and app-db is nil. However after I trigger an event of my own the :initialize-db event appears and has the correct app-db

sandbags18:04:43

the REPL paste stuff is great

sandbags18:04:32

re-frame 0.10.5, re-frame-10x 0.3.3 re-frame-tracing 0.5.1 reagent 0.8.0

shaun-mahood19:04:33

@sandbags: What events are you expecting to see before your initialize-db event?

sandbags21:04:53

It’s the initialise-db event i am expecting to see @shaun-mahood

sandbags21:04:08

but it doesn’t appear until after another event has been dispatched.

shaun-mahood21:04:49

@sandbags: Ahh I misunderstood - I think I was having the same issue earlier as well, let me check if anything comes up with only the first event firing.

shaun-mahood21:04:09

@sandbags: I get the same behaviour if I only dispatch one event. @Everything comes up as expected with 2 or more. So it looks like it's not just you at least.

danielcompton21:04:39

@sandbags we don't trace dispatch-sync events yet

👍 4
danielcompton21:04:46

I think that's the issue you're probably seeing

danielcompton21:04:49

ah, reading your comments, there might be something more

danielcompton21:04:10

can you open an issue?