Fork me on GitHub
#rum
<
2017-11-22
>
sova-soars-the-sora18:11:47

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-soars-the-sora18:11:09

i'm still learning but let's see what we can do, to add an editable text area...

sova-soars-the-sora18:11:55

that one takes a "mixin" but the main idea is the same...

sova-soars-the-sora18:11:09

you have the html element represented in hiccup, with [:input {} ]

sova-soars-the-sora18:11:31

you have a special javascript-like on-change that is presumably handled by the mixin...

sova-soars-the-sora18:11:24

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) ...

sova-soars-the-sora19:11:46

So the only mssing piece is storage: the atom.

Ale20:11:05

@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 solutions (plus a lot of variations on them): https://gist.github.com/93e185584e48d866bd45fab7f0cbe3ac but no luck

sova-soars-the-sora21:11:22

Slate is its own .js file right?

sova-soars-the-sora21:11:24

oh I see, there is one in cljsjs

sova-soars-the-sora21:11:24

[cljsjs/slate "0.21.3-0"]

sova-soars-the-sora21:11:27

hmmm this is a cool library

sova-soars-the-sora21:11:09

@anmonteiro have you used Slate via cljsjs at all sir?

sova-soars-the-sora22:11:45

Is there a way to do nested atom data in rum? like (atom {:key stuff :key3 stuff3 }) and then deref to that somehow?

sova-soars-the-sora22:11:18

what's the recommended way to put a lot of "variables" in a single atom?

sova-soars-the-sora22:11:16

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....

sova-soars-the-sora23:11:10

I'm so confused with the atoms and rum state. I'm sure it will all fall into place soon, though. Hmmm