Fork me on GitHub
#re-frame
<
2016-10-10
>
lxsameer10:10:20

hey folks, how should I implement a sidebar component in theory ? the sidebar trigger is my concern ?

yury.solovyov10:10:52

like, with hamburger menu button?

savelichalex10:10:45

@lxsameer block with "position: absolute" and "left: -(blockWidth)"?

lxsameer10:10:57

@savelichalex i see, i meant the re-frame solution.

lxsameer10:10:46

In fact I'm a bit confused about implementing a functionality which we already implemented using a jquery plugin

lxsameer10:10:53

using re-frame

savelichalex11:10:30

@lxsameer and what the big deal? just trigger event that change sidebar styles, in css you can apply transitions

savelichalex11:10:07

subscribe to field in app-db, smth like :sibebar-open bool and change it

lxsameer11:10:56

but how should i use the modules and libraries from js and jquery in clojurescript ? Just requiring them ?

yury.solovyov11:10:56

depends on what you actually need

yury.solovyov11:10:26

there are a lot of DOM-related stuff in google closure library

lxsameer11:10:06

so the default tools for doing similar stuff is google closure

yury.solovyov11:10:48

yup, they are efficient and battle tested

yury.solovyov11:10:21

though if you are doing re-frame app, you might not need them, if your menu+activation button are just reagent components, you already have all you need

lxsameer11:10:06

yury.solovyov I have to test this stuff, I may ran into problems

lxsameer11:10:25

so I don't know anything right now 😛

yury.solovyov11:10:48

it is just that you barely need to manually touch the dom

yury.solovyov11:10:59

in reagent/re-frame

yury.solovyov11:10:12

pretty much like in react

lxsameer11:10:22

hmm so the chances to use some libs like WOW is bare minimum, am i correct ?

yury.solovyov11:10:40

I didn't used WOW

yury.solovyov11:10:29

basically some popular libs adapted for cljs

lxsameer11:10:42

cool thanks

andre14:10:28

that's how I imagine re-frame data flow visualization 🙂

andre14:10:48

Visual Programming Environment very well suited to the re-frame https://youtu.be/WjJdaDXN5Vs?t=22m31s

plexus15:10:38

The #lambdaisland episode on re-frame is out https://lambdaisland.com/episodes/re-frame

plexus15:10:23

sorry, it's paywalled. You can watch it on the free trial if it hasn't expired yet

plexus15:10:17

or just sign up for a month to see what it's like 😉 you can cancel at any time, your subscription will stay active until the end of the month. If it's really too expensive for you then ping me we can work something out!

lxsameer19:10:29

manipulating dom directly (using jquery or something) is a bad thing in re-frame right ?

lxsameer20:10:13

and what is the best way to add and remove classes from body ?

mattly20:10:59

@lxsameer typically such things are done "outside" of your react-ish application, in the same place you might f.e. instantiate components

mattly20:10:11

but, being pragmatic, when working in React in the past I've leveraged the component lifecycle to do state-driven imperative dom operations

mattly20:10:19

I haven't had the need yet to do that in re-frame

lxsameer20:10:34

@mattly good to know thanks

mattly20:10:39

but if I didn want to do that, I think my approach would involve reg-event-fx mutations

mattly20:10:19

the idea being, your component somewhere triggers an event that triggers an imperative operation on the body element

lxsameer20:10:44

@mattly aha , I read about it before

mattly20:10:45

the new reg-event-fx and reg-fx stuff in 0.8 is pretty powerful

mattly20:10:25

you can use it for triggering just about anything that doesn't involve mutating the app state directly

josh.freckleton20:10:09

w.r.t. reg-fx / reg-cofx, i'm coming back to re-frame after a hiatus, and it looks like a bunch of cool stuff has been added. What's the best resource for catching up on the changes?

lxsameer20:10:23

@mattly so you know how can i tell if a library is google closure compatible or not, by any chance ?

mattly20:10:16

pretty much anything I've needed was on cljsjs

josh.freckleton20:10:42

@mattly: thanks! I'll read through em! Are these (co)effects related to the category theory notion, ex: http://tomasp.net/coeffects/

josh.freckleton20:10:23

nm, as I'm reading thru, they are, and i'm excited to be working with re-frame again! haskell was my re-frame-hiatus, and to see C.T. coming into clojure is sweet!

josh.freckleton21:10:00

@mikethompson ah, good call thanks, that'll give me a high level view