Fork me on GitHub
#re-frame
<
2018-10-22
>
raymcdermott19:10:56

I’m using figwheel with re-frame, which I assume is fairly idiomatic

raymcdermott19:10:52

I would like to prevent the db from being reset on code changes …. is there a standard pattern for achieving this?

bfay20:10:59

It's been a good year or two since I've touched re-frame, but I don't recall the db ever changing when I saved code and had figwheel update it. I don't think I had to do anything special to opt in to that behavior

isak20:10:29

@raymcdermott just make sure you use defonce for the db

raymcdermott20:10:20

@isak yes I have tried that but am still getting some value replaced

raymcdermott20:10:08

maybe I have misspoken … cos now I am debugging some more it seems like its just external JS objects

bfay20:10:25

hmm, maybe there is a dispatch being triggered in your code somewhere that's not behind a defonce?

raymcdermott20:10:30

I am using code-mirror and it is being lost on reload

isak20:10:10

ah, right for those you need special handling to get it to work - see the handling stateful js components doc

raymcdermott20:10:41

ah OK I haven’t came across that one

raymcdermott20:10:49

I’ll look it up - thanks

👍 4
raymcdermott20:10:11

Ok, I’m not following that pattern … awesome - thanks @isak

raymcdermott20:10:40

and @bfay I agree with your general advice - so thanks, I should have been clearer

raymcdermott21:10:25

for CM I needed to add a noop fn for component-did-update so a small variation on that theme