Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 10 01:30
    Azzurite opened #237
  • Apr 10 01:11
  • Apr 07 07:41
    jwr commented #235
  • Apr 06 12:58
    Jarzka closed #236
  • Apr 06 12:58
    Azzurite commented #236
  • Apr 05 15:43
    Azzurite commented #236
  • Apr 05 15:41
    roman01la commented #236
  • Apr 05 15:38
    Azzurite commented #236
  • Apr 05 12:47
    Jarzka commented #236
  • Apr 05 09:38
    roman01la commented #236
  • Apr 05 09:37
    roman01la commented #235
  • Apr 05 09:34
    jetmind commented #235
  • Apr 04 17:33
    roman01la commented #236
  • Apr 04 10:24
    Jarzka commented #236
  • Apr 04 10:23
    Jarzka commented #236
  • Apr 04 10:21
    Jarzka commented #236
  • Apr 04 10:20
    Jarzka commented #236
  • Apr 03 22:29
    roman01la commented #236
  • Apr 03 15:23
    Azzurite commented #236
  • Apr 03 10:46
    Jarzka edited #236
matrixbot
@matrixbot
sova my cljs is a bit rusty xD but that did work.
sova jfntn you can use cljs/clj conditional lines
sova have you seen those around?
sova so in your serverside code you can have the "do this if it's we're in a clj world, this other line if we're in cljs land"
matrixbot
@matrixbot
sova How do you nest components in rum? Like "big component has 9 tiny components inside" ?
matrixbot
@matrixbot
tonsky jfntn I remember there has been some work to support meta on vars in cljs. Not sure the status
tonsky sova
(rum/defc big-comp []
  [:div
    (small-comp) (small-comp) (small-comp)])
matrixbot
@matrixbot
sova tonsky thanks dude! this is so effin cool. just throw it in a div, BAM. donezo.
matrixbot
@matrixbot
sova I will have more newbie questions soon so stay tuned :]
matrixbot
@matrixbot
sova tonsky I'm so stoked to use Rum.
sova I just started a new project with Sente + Rum and i have a feeling it'll be an unstoppable combo
matrixbot
@matrixbot
tonsky Cool
matrixbot
@matrixbot
sova tonsky how does rum make sure all the react ids in server side rendering get preserved? I want to serverside render this page and serve it, and when the js loads it will automatically know the right IDs without full refresh?
matrixbot
@matrixbot
sova πŸ™‚ Is there a way to do swipe gestures in rum?
matrixbot
@matrixbot
sova roman01la Hey thanks man! 2 questions: can I just use rum where you use prum and could you explain line 58 with the [state ::state]
matrixbot
@matrixbot
roman01la Yes you can. that line is destructuring components local state, see Rum’s docs for defcs macro
matrixbot
@matrixbot
sova Thank!s
matrixbot
@matrixbot
laynor Hi, I'm playing a bit with rum and trying to integrate Slate into my toy app. How would I port something simple like https://gist.github.com/3eb041f4c69f021b0952512cb4ecf576 to cljs/rum?
matrixbot
@matrixbot
sova mmm just about the same way except you need to use rum local store (like a clojure atom) to keep track of the variables
sova i'm still learning but let's see what we can do, to add an editable text area...
sova laynor Here, look at the examples: http://tonsky.me/rum/ and find the input field, and then look at the code here: https://github.com/tonsky/rum/blob/gh-pages/examples/rum/examples/inputs.cljc#L10
sova that one takes a "mixin" but the main idea is the same...
sova you have the html element represented in hiccup, with [:input {} ]
sova you have a special javascript-like on-change that is presumably handled by the mixin...
sova when the value changes, the atom which is indicated by *ref is adjusted (well, in this case, reset!, but swap! is the same i believe) ...
matrixbot
@matrixbot
sova So the only mssing piece is storage: the atom.
matrixbot
@matrixbot
laynor sova thanks πŸ™‚ working with standard html elements like input and such is not an issue though... I'm having difficulty integrating Slate. I had success integrating other external (from cljsjs) react components (just airbnb's date pickers, to say the truth) but can't guess how to make slate work. I tried these solution (plus a lot of variations on them): https://gist.github.com/93e185584e48d866bd45fab7f0cbe3ac but no luck
matrixbot
@matrixbot
sova Hmm
sova Slate is its own .js file right?
sova oh I see, there is one in cljsjs
sova [cljsjs/slate "0.21.3-0"]
sova hmmm this is a cool library
sova anmonteiro have you used Slate via cljsjs at all sir?
matrixbot
@matrixbot
sova Is there a way to do nested atom data in rum? like (atom {:key stuff :key3 stuff3 }) and then deref to that somehow?
sova what's the recommended way to put a lot of "variables" in a single atom?
matrixbot
@matrixbot
sova Hi i'm trying to do some validating inputs like on the example page, but I can't seem to get any reactivity from the page when i change the text....
matrixbot
@matrixbot
sova I'm so confused with the atoms and rum state. I'm sure it will all fall into place soon, though. Hmmm
matrixbot
@matrixbot
laynor sova Not an expert but i guess you can write (:stuff (rum/react myatom)) in the component body
matrixbot
@matrixbot
sova Thanks! I made some headway: if you want to reference a value and change it you can use (rum/cursor atom :key) to get a top-level key and (rum/cursor-in atom [:key1 :subkey1]) to get a nested key... and if you want to display the value, just use a let like (let [ super-email-val (rum/cursor app-state-atom :email] .... and later on you can say @super-email-val to display the val, and you can use (rum/react super-email-val) to watch for changes
matrixbot
@matrixbot
laynor It seems cljsjs/slate has some issues cljsjs/packages#954 πŸ˜• I'm finally playing with draft js, it worked straight away ^^
matrixbot
@matrixbot
sova laynor interesting! good detective work sir. slate looks neat but something that works always beats something that doesn't lol
matrixbot
@matrixbot
grumplet Just checking. Rum on GitHub has pulled in extensions marked WIP to extend it to 15.6.2. Are these extensions good to use yet?
matrixbot
@matrixbot
tonsky grumplet should be good
tonsky next release will contain full migration to 16 though
matrixbot
@matrixbot
grumplet tonsky Thanks for the update πŸ™‚
Nikita Prokopov
@tonsky
THIS CHANNEL IS CLOSED IN FAVOUR OF SLACK. Grab invite here http://clojurians.net/, join https://clojurians.slack.com, look for #rum channel. PLEASE DON’T ASK QUESTIONS HERE
Nanoplink
@nanoplink
Thanks for Rum :D
Pratap Sharma
@Pratap22
Hey guys