Fork me on GitHub
#hyperfiddle
<
2023-03-08
>
Can11:03:09

Hello, how can I select an element to manipulate it? (like as in js/doc selectors) In example; When I click button (you can see in screenshot) then i want to change some properties, values etc on input element. Or something like that. I checked all demo projects but didn't see clear examples about it, if there is an example sorry about that 🙂 Can anyone help me about it with some simple examples 🙂

👀 2
✅ 2
Can15:03:39

any ideas? 🙂

xificurC19:03:49

Hi! IIUC you're asking how e.g. a button could change the input's background color, does that capture the essence? The cleanest way I can think of is to create an atom above them and change that

Can19:03:15

Thank you for your help!

Can20:03:40

I wonder don't we use (document.queryselector - css xpath jquery etc) kind codes in electric? I felt like that because I didn't see similar kinds of codes.

👀 2
xificurC20:03:07

we prefer to derive the UI from data, in which case the coordination happens around it, in this example it's an atom, in another it would be database query results. You might need selectors to target third party HTML

Dustin Getz19:03:37

hi @U04SVJW7DLZ I appreciate your questions. I hope to work on a beginner's guide in the next few weeks. It's true that we don't use selectors. We're trying to make it feel like PHP, as direct as possible with no wiring. Please keep asking questions. I will use these conversations as feedback for better docs

Michael W17:03:21

I'm getting a weird error trying to use a library under electric: "No implementation of method: :start! of protocol: #'com.fulcrologic.statecharts.protocols/Processor found for class: com.fulcrologic.statecharts.algorithms.v20150901.Processor But I can see the method start! on the protocol, and loading it without electric is working fine. Is there something special I need to do for protocols? Trying to use this statecharts library: https://github.com/fulcrologic/statecharts

✅ 2
Dustin Getz18:03:46

hey, can i see a gist

Dustin Getz18:03:17

actually this may be the same error as we saw with XTDB

Dustin Getz18:03:09

can you try upgrading to 4012a6b10abd5edc02f5dc45744351c84bf4f3a8 using {:git/url ... :git/sha "4012a6b10abd5edc02f5dc45744351c84bf4f3a8"}

Michael W18:03:51

Yeah I'll try upgrading if it's still a problem I'll get a repo opened.

Dustin Getz18:03:24

ok and if you still have an error please send the stack trace and a copy/paste of the code

Michael W18:03:59

Damn I just closed the chrome with that right before you asked.

Michael W18:03:46

That newer sha seems to be working now.

Dustin Getz19:03:35

Ok, good. This also should resolve the XTDB problems, though I haven't confirmed it yet. I'll cut a new release along with the upcoming deployment changes

Dustin Getz19:03:13

The v2-123 hot code reloading changes broke dependency namespaces (i.e. from deps not app src) that use defprotocol , it's fixed in master