Fork me on GitHub
#ldnclj
<
2015-10-09
>
xlevus08:10:36

morrrrning

gjnoonan09:10:07

How is everyone today?

thomas09:10:36

it is Friday..... yeah.....

thomas09:10:47

what else do I need to say....

mccraigmccraig09:10:03

friday ? what's that ?

thomas09:10:09

ooh and @malcolmsparks and I are going to submit a talk to ClojureExchange!

thomas09:10:21

it is the day after a Thursday.

mccraigmccraig09:10:56

i've lost track of days, i have a deadline and am being bitten by hofstatder's law

Pablo Fernandez09:10:16

I’m starting to have the impression that not many people are using re-frame.

thomas09:10:15

@mccraigmccraig: not good.. hopefully you have time soon again to keep track of days and enjoy them again!

mccraigmccraig09:10:48

@pupeno: perhaps not - it's dead simple though, so i don't mind

Pablo Fernandez09:10:51

@mccraigmccraig: yes, it is simple, but for me, there a lot of holes that I can fill up with hacks, but I’d rather fill up with proper solutions, but since I’m new to reactive programming, re-frame, reagent, reactjs, clojurescript and clojure I’m having trouble judging the proper solution from the hacks. For example, I haven’t seen a single example, doc or anything about dealing with forms.

mccraigmccraig09:10:47

ha, yeah, that's a lot of stuff to get to grips with at the same time

mccraigmccraig09:10:28

if i had a lot of forms i would probably want to build a lib to help with validation etc... since i don't, i'm happy with just using raw :on-change / :on-click handlers

Pablo Fernandez09:10:53

How are you getting the values from the inputs?

mccraigmccraig09:10:17

(-> e .-target .-value) in :on-change iirc

Pablo Fernandez09:10:44

Ah, ok. Yeah. I saw that, but for big forms I’m not a fan.

mccraigmccraig09:10:03

no, it wd b a pita for big forms

Pablo Fernandez09:10:34

reagent-forms helps a bit, bit it has its own state.

agile_geek09:10:39

@pupeno: @mccraigmccraig: I haven’t managed to get past the README for re-frame yet. Tried to do something in it during a Dojo but spent 30 mins trying to work out how to do anything then switched the learning enough reagent to do same thing…I’ll revisit at some point but as it’s ‘if and when I get time’ for me rather than the day job it could be a while.

xlevus10:10:59

I found re-frame to make a lot more sense than plain reagent.

Pablo Fernandez10:10:27

xlevus: Oh, I really like it.

xlevus10:10:37

yeah, it's the tits. (re-frame)

Pablo Fernandez10:10:10

It’s just that forms seem to have been largely ignored, so I guess I’ll have to build the library to build forms.

xlevus10:10:30

although, I do wish they bundled some syntatic-sugar macros for handlers/subs/views in the box.

mccraigmccraig10:10:38

yeah, i'm finding re-frame makes a lot of sense, the major pain point being evolving from a small app to a larger app

Pablo Fernandez10:10:04

When you are doing reactive programming, forms become a little bit harder than normal HTML because you don’t have the submit process were all values are gathered in a map and sent to you.

Pablo Fernandez10:10:31

The Chrome debugger works better than I expected on cljs code.

Pablo Fernandez10:10:04

Nice, assoc-in can take an index for sequential collections.

xlevus10:10:55

(assoc [0 0 0] 3 1) -> [0 0 1] ?

Pablo Fernandez10:10:47

(assoc-in [0 0 0] [2] 1)

xlevus10:10:22

durr, 0-index. Brainfart.

Pablo Fernandez10:10:43

Oddly enough, I made the mistake.

Pablo Fernandez10:10:56

I don’t think I ever used a language with a 1-index.

Pablo Fernandez10:10:19

Anyway, it’s assoc-in, the big brother of assoc.

mccraigmccraig11:10:45

@pupeno: wat ? can u set cljs breakpoints ?

agile_geek11:10:44

@pupeno: you can assoc into a sequence as well as assoc-in (assoc [0 0 0] 2 1)

Pablo Fernandez11:10:42

mccraigmccraig: yes, you can.

Pablo Fernandez11:10:24

mccraigmccraig: it’s not perfect, but it allowed me to fix a bug already, so it qualifies as debugger in my book.

mccraigmccraig12:10:33

@pupeno: how do you set breakpoints ? i navigated to a .cljs source file and the ui says it has set a breakpoint, but it doesn't seem to work...

mccraigmccraig12:10:11

hmm - but it paused when i refreshed the page - so it does work

Pablo Fernandez13:10:41

I… don’t know. It is very flaky.

Pablo Fernandez21:10:32

I accidentally created a form library that’s re-frame friendly… https://github.com/carouselapps/ninjatools/blob/master/src/cljs/re_forms/core.cljs oh well.