Fork me on GitHub
#re-frame
<
2023-09-29
>
Ryan18:09:15

Hmm, I’m getting the re-frame:subscribe called outside reactive context.. but I’m not using subscribe in an event handler, I’m getting the error while updating an atom.. any clues as to what conditions might cause that?

p-himik18:09:32

That warning should have a stacktrace that points to the exact location.

Ryan18:09:14

seems to end in goog.events.handleBrowserEvent … I don’t see an entry in the stack trace that corresponds to any of my code

Ryan18:09:17

hmmm, I have a popup that has a form backed by an atom.. I bet that popup is connected to an on-click to show the popup.. could that make everything inside that popup be a non-reactive context?

Ryan18:09:50

Oooooh.. it looks like it might be coming from re-pressed

Ryan18:09:25

which makes sense at least because it was firing on tabbing between fields on that form which should not itself update the atom!

Ryan18:09:27

now how to fix

p-himik18:09:40

I simply wouldn't use re-pressed. It's not that much of useful code, you can write your own keyboard event handling in a handful of lines. IMO there's little need to store current shortcut mappings in app-db, as re-pressed does, unless your app must consider it a part of its state for some reason. In which case, you can always use global interceptors to trigger actual listeners re-assignment.

Ryan18:09:30

Makes sense, thanks for the advice as always

👍 1
Casey18:09:58

What are folks using for app-dbs these days? Plain maps, datascript, doxa, re-db, etc? (on new/greenfield prod projects)

p-himik19:09:43

I use a combination of plain values under some specific keys and a specifically structured nested collection to store normalized data that allows easy updates and queries of the data that I need.

Casey19:09:56

What are you using for manipulating and querying normalized data?

Casey19:09:56

That's essentially what I am after. Im working with datasets that aren't huge (~100s of entities) but have lots of internal references

p-himik19:09:33

A hand-rolled solution that started from subgraph that I've eventually completely rewritten with my own needs in mind. :) Not open-source yet.

p-himik19:09:42

A few links to related projects, if you're interested. Some of them might or might not be suitable for use with re-frame. • https://github.com/hodur-org/hodur-enginehttps://github.com/den1k/subgraphhttps://github.com/riverford/compound (a supposedly extended and improved version: https://github.com/riverford/compound/tree/compound2) • https://github.com/lilactown/pyramidhttps://github.com/wotbrew/relichttps://github.com/juxt/pull

mikethompson22:10:01

From browsing these over time, I think that relic and doxa look the most promising. Note: I've done no deep dive, just browsed. And I probably haven't looked at them all.

🙏 1