Fork me on GitHub
#re-frame
<
2018-04-05
>
caleb.macdonaldblack04:04:04

When using input-signals in re-frame, would you intentionally nest grouped data in app-db in order to improve the efficiency of subscriptions?

danielcompton04:04:44

There's a demo site coming up soon to let you explore it on your own too

danielcompton08:04:02

Here's the demo site, so you can start playing around with it https://jacekschae.github.io/conduit-re-frame-10x-demo/

4
robert-stuttaford09:04:05

man this is an awesome bit of kit. that new source tracing thing is going to be killer

danielcompton10:04:50

When we get it working on your project!

danielcompton10:04:58

It’s from cljs 1.10

danielcompton10:04:23

I made a PR to cljs-devtools, will be fixed in next release

danielcompton10:04:27

Cljs 1.10 adds a MapEntry type which is rendered in full there

darwin12:04:47

@curlyfry I’m going to cut a new release today

javi13:04:00

Hi! Where can i find some info about current best practices for running more than 1 re-frame app in the same context? ie: I have a live editor that runs on re-frame and i am writing guides to re-frame in the live editor Is name-spacing events and subscriptions and the data in the db itself the best approach? are there any interceptors/middleware that simplify this? tx

robert-stuttaford13:04:04

i recently skirted around this when i tried to devcards my re-frame app. i gave up, because re-frame is really designed as a singleton. namespaced keys are likely your best bet, @fj.abanses. happily, that approach gives you a lot of other goodness, the least of which is the greater likelihood that you’ll use spec for your app db 🙂

MegaMatt16:04:30

can you point me to any examples for specing out app db? i'd like to learn how to do that

reefersleep22:04:13

I use the event registering wrapper at the bottom of that file instead of the vanilla one to ensure that I hit my interceptors for all events

reefersleep22:04:57

This is conventional re-frame btw, straight from an example in the docs somewhere

reefersleep22:04:23

App-state is the relevant one

MegaMatt01:04:27

thanks. I'll definitely take a look

javi13:04:12

@robert-stuttaford ha ha 🙂 thanks!! i have another app that uses fact-ui as the db with re-frame and i made fx/cofx that inject the db around like re-posh does with the datascript db .. and works great...as far as i am aware... I may give something like that a try... and spec it too 🙂

robert-stuttaford14:04:44

re-frame-10x tracing - when i switch it on, i get Error compiling debux/common/util.cljc error. pretty sure i’m doing things as i should be. @danielcompton / @mikethompson? https://github.com/robert-stuttaford/bridge/tree/1219d9c7eb56ce06bd67050f2cd3a83da796f9ab

curlyfry14:04:55

@darwin @jacek.schae Awesome! I think the live demo is great advertising for both re-frame and re-frame-10x 🙂

darwin14:04:22

@fj.abanses a few years back I wrote https://github.com/binaryage/pure-frame, but didn’t get back to it to update it to match latest and greatest re-frame, your best bet is to use different iframes to host independent re-frame instances I guess

soulflyer14:04:56

@robert-stuttaford that looks a lot like one of the messages I was seeing when I first tried adding the 10x tracing. I don't know the exact root cause, but it disappeared somewhere along the route of upgrading pretty much everything in my project.clj to the latest versions. Are you using lein? if so lein ancient is your friend. edit: hmm, I see your setup and the important things are all bang up to date. Only obvious difference to my now working setup is I'm on react 15 and 10x 0.3.0.

javi14:04:49

@darwin i found that in my research 🙂 thanks for the status update on it. I am having a go at name-spacing data/evts/subs and then injecting the ns at some point so i dont have to pass it around.. will be good enough for my use case i think... will report back

robert-stuttaford14:04:15

@soulflyer yes, thanks - that was the first thing i checked 🙂 i used https://github.com/Olical/depot to check

soulflyer14:04:39

Ah ha, lein ancient for edn files. That's good to know.

danielcompton18:04:35

@matthewdaniel what does your ns form look like?

MegaMatt19:04:19

@danielcompton this is what you mean right?

danielcompton19:04:15

Yeah change that refer to refer-macros

danielcompton19:04:46

Also, is that :refer shown in the docs somewhere? It should be changed

MegaMatt19:04:23

it is shown here

raymcdermott23:04:24

hello peeps - I am trying to set the cursor position in a textarea after an update from the server. I was thinking I could set the property selectionStart from a subscription but I can’t find a way to set it… is it possible?

danielcompton23:04:47

You might need to move to a form-3 component which gives you more control over the rendering lifecycle

danielcompton23:04:09

Although we weren't trying to change the scroll position in response to updates, just preserve it across re-renders

raymcdermott08:04:30

Thanks - I’ll look into it

raymcdermott23:04:24

with that approach I was able to set the cursor position - so thanks very much

👍 4