Fork me on GitHub
#re-frame
<
2017-04-25
>
ckirkendall13:04:59

I found an interesting bug and was wondering if others have ran into it. It turns out if you register a sub to a keyword where the keyword is acting as the handler like so (reg-sub ::my-sub :data-key) you get some very odd behavior when the key is not present in the db. One would expect the subscription to return nil when the keyword is not present but instead it returns the subscription vector. So if db is {} and we call @(subscribe [::my-sub]) we get [::my-sub] as the return value instead of nil.

mikepence14:04:43

so I am having some weirdness where my app is still saying "Hello from re-frame" when I have already removed that view logic from the app.

mikepence14:04:07

is there some command aside from lein clean I need to use to reset all of the cached stuff?

mikepence14:04:38

so the issue is with chrome. it keeps holding on to the older version of the page.

mikepence14:04:39

Ctrl+F5 is my friend

kasuko14:04:30

@ckirkendall That’s because the subscription handler is passed the db AND the subscription vector. So your subscription is essentially handled like (:data-key {} [:my-sub])

kasuko14:04:54

I’m pretty sure a key as a function is just the same as calling (get {} :data-key [:my-sub]) so you are actually passing in the subscription vector as the “default value if none exists” parameter

ckirkendall15:04:11

ah that makes total sense now

kasuko15:04:48

No problem

mikepence16:04:50

looking for opinions about what tool to use for browser-based tests

mikepence16:04:04

I am used to selenium but from ruby-land

romain17:04:54

@mikepence did you check in Settings / Preferences / Network / Disable cache (while DevTools is open) ?

mikepence18:04:30

will do, thanks romain

mikepence18:04:43

err..super noob-style questions, but how do I get into my viewer.views ns in figwheel?

mikepence18:04:15

(in-ns viewer.views) gives me a stack trace

souenzzo21:04:42

(in-ns 'viewer.views)

nicola18:04:43

Hi, re-framers. What recommendations for a lot of forms - any opinionated form builders?

mikepence18:04:51

maybe I should just be doing a lein repl

timgilbert21:04:25

@nicola, you could try re-com. IMHO form-handling is incredibly painful in react generally though, and I've contemplated switching to (gasp) jQuery or something for our form-heavy apps.

timgilbert21:04:12

I'll be interested to hear back if you find something that's easy to use

timgilbert21:04:47

Another route is to explore the google Closure stuff, since you get all of that "for free" with the compiler. It tends to be heavily imperative, though, so it's not necessarily the best fit for ClojureScript. But there are a ton of controls and they generally have been well-tested and implemented