Fork me on GitHub
#luminus
<
2017-01-04
>
dhruv00:01:09

when you say bind-queries, is that the same as conman/bind-connection? i've tried rerunning that in the repl after sql file changes, and then calling (reset) to get mount to reinitialise all components, however my code still references the original sql file

yogthos00:01:37

@dhruv err yeah sorry typo there, I meant bind-connection

yogthos00:01:02

note that you shouldn't need to reinitialize the components

yogthos00:01:30

bind-connection should be reloading the function definitions in the namespace, the mount state is only managing the connection itself

yogthos00:01:54

I did have issues in cursive where it caches files

yogthos00:01:10

so even when you change the sql file on disk, it's still the old file in the IDE

yogthos00:01:48

but that's an intellij specific issue

dhruv00:01:38

ahh thanks for that.. yep i think i may be facing a caching issue. if i call bind-connection and then call (my-query) in the repl, it reflects the changed sql file. however if i call (my-query) from another namespace, it still seems to cache the old value

dhruv00:01:49

thanks for your help

yogthos00:01:25

oh in that scenario it is actually the namespaces that need to be reloaded, not an issue of IDE caching

yogthos00:01:44

you do have to use (refresh-all) then or at least refresh the referencing namespaces

yogthos00:01:27

it's due to the fact that the other namespace references a stale var after bind-connection reloads it

dhruv00:01:18

perfect - thanks for explaining! 🙂

dhruv00:01:47

yogthos for president 2020: make debugging great again

gdeer8116:01:46

does the Luminus template use component now?

yogthos19:01:34

nope, still on mount 🙂

yogthos19:01:10

I'm just using the term component to refer to stateful resources

gdeer8119:01:35

ah okay, I've watched so many talks on stateful component management and it all made so much sense but then when I start a new project I totally forget all about it. That's what I like about luminous, encourages best practices by default

mbcev23:01:13

I'm somewhat inexperienced with both Clojure and Luminus so forgive if this is silly. I'm following along with the Web Dev with Clojure book and am trying to understand the Reagent section.

mbcev23:01:13

I've got some sample code (just an atom, a function which generates a block of html and pulls values from the atom, and a render function) which runs fine in my application core namespace but when I move it into it's own namespace separate from core it isn't running anymore.

mbcev23:01:39

core is the only entrance to the CLJS code that runs right? and since JS isn't multithreaded that means that I need to write my app logic in core and just refer to project.other_namespace functions right? or no...

mbcev23:01:26

Basically I'm trying to understand the appropriate CLJS pattern for refactoring code I guess. I'm writing little widgets and thought it would make sense to put the logic for each widget in its own namespace I guess.