Fork me on GitHub
#re-frame
<
2016-11-14
>
richiardiandrea04:11:05

@sandbags I have experieced that yes when adding the debug interceptor to a handler, but it was so intermittent that I did not explore it further

danielgrosse10:11:10

I have a problem with a subscription which is not reacting as I want it. I registered a handler, which updates the db. The db is set to an empty map for this case. On the loading process, the db is filled with data from an external source. When this happens, the handler is called and the db is set correctly, but the subscription doesn't react.

danielgrosse10:11:58

The log reads 1. Menu refreshed 2. Menu data {:categories [], :tours []} 3. Menu Handler called

danielgrosse10:11:34

So shouldn't the subscriptions be called, after the handler changed the Database?

sandbags12:11:41

@richiardiandrea hrmm... i've not used interceptors (indeed just reading about them now and they may address some of why i am poking about in the console anyway)

sandbags12:11:00

I'm literally baffled that, what I think is the source of the data the subscriptions are returning, is nil

sandbags12:11:33

I don't see how this can be unless re-frame is secretly storing the data somewhere else or Atoms can have multiple values in different contexts which seems, somewhat, counter to their purpose

sandbags12:11:34

(and also doesn't explain why it would be nil in any context)

mccraigmccraig12:11:31

@sandbags have you checked that the js context in your repl is the correct one ? (it happens sometimes for me that i have multiple browser windows, or mobile simulators, or actual phones, open and it can be random which one gets to attach to the repl)

sandbags12:11:04

@mccraigmccraig i think you have it... i switched to Chrome briefly to test something and forgot to close it!

sandbags12:11:22

i bet it's figwheel loader was getting there first!

sandbags12:11:51

thank you... at some point i would have closed Chrome without making the connection and the "bug" would have mysteriously disappeared leaving me very confused 🙂

mccraigmccraig12:11:19

race-condition FTW 🙂

sandbags12:11:25

and there's my app-db!

sandbags12:11:01

tip 'o the hat to the clan mccraig for the save there!

sandbags12:11:52

also i now get to see how interceptors change my life so thank you also @richiardiandrea

andre19:11:30

what do you guys think? it would be nice to have this feature in re-frame apps

andre19:11:49

i tried to implement time traveling in the https://github.com/flexsurfer/re-frisk library. but i need re-frame data, and i think it will be easy to implement export/import functionality, we just need initial state and an entire list of events

danielcompton19:11:53

You can do this with the undo/redo list of events

danielcompton19:11:18

but it's not as polished/easy to turn on as Elm's one

ericfode23:11:22

@andre re-frisk is a great idea! +1