re-frame

sveri 2018-04-23T07:59:24.000422Z

@sveri has left the channel

sveri 2018-04-23T07:59:32.000102Z

@sveri has joined the channel

sveri 2018-04-23T08:00:35.000494Z

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?

eoliphant 2018-04-23T11:39:45.000245Z

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 😉

sveri 2018-04-23T13:45:11.000179Z

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-mahood 2018-04-23T14:59:34.000056Z

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-mahood 2018-04-23T15:08:35.000727Z

@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.

2018-04-23T16:12:58.000136Z

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

2018-04-23T16:13:14.000674Z

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

2018-04-23T16:13:19.000401Z

one that I was referencing was https://github.com/johnswanson/re-frame-debounce-fx

2018-04-23T16:13:55.000274Z

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)

sveri 2018-04-23T16:15:04.000048Z

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

alex-dixon 2018-04-23T16:16:40.000467Z

Yarg…ok. Thanks @mikerod

2018-04-23T16:24:06.000353Z

The good news is I think implementing it is relatively straightforward

alex-dixon 2018-04-23T16:37:49.000750Z

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

👍 1
sandbags 2018-04-23T18:39:44.000581Z

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.

👍 1
sandbags 2018-04-23T18:40:08.000315Z

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

sandbags 2018-04-23T18:40:55.000203Z

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

sandbags 2018-04-23T18:41:43.000296Z

the REPL paste stuff is great

sandbags 2018-04-23T18:43:32.000352Z

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

shaun-mahood 2018-04-23T19:00:33.000622Z

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

sandbags 2018-04-23T21:14:53.000031Z

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

sandbags 2018-04-23T21:15:08.000475Z

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

shaun-mahood 2018-04-23T21:21:49.000452Z

@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-mahood 2018-04-23T21:26:09.000202Z

@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.

danielcompton 2018-04-23T21:37:39.000432Z

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

👍 1
danielcompton 2018-04-23T21:37:46.000380Z

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

danielcompton 2018-04-23T21:38:15.000209Z

https://github.com/Day8/re-frame-10x/issues/154

danielcompton 2018-04-23T21:38:49.000397Z

ah, reading your comments, there might be something more

danielcompton 2018-04-23T21:39:10.000227Z

can you open an issue?

eoliphant 2018-04-23T02:19:45.000102Z

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

2018-04-23T02:20:32.000203Z

Using the right version of React/Reagent?

2018-04-23T02:21:09.000104Z

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

eoliphant 2018-04-23T02:21:34.000155Z

yeah react 16.3.. reagent 0.8.0 etc

eoliphant 2018-04-23T02:21:38.000137Z

ok will give that a try

danielcompton 2018-04-23T02:23:06.000081Z

What version of 10x?

eoliphant 2018-04-23T02:26:27.000060Z

0.3.2-react16

eoliphant 2018-04-23T02:32:56.000114Z

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

eoliphant 2018-04-23T02:32:59.000147Z

thanks

eoliphant 2018-04-23T04:19:40.000018Z

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.

eoliphant 2018-04-23T04:38:02.000106Z

ah great

eoliphant 2018-04-23T04:38:04.000018Z

thanks !