hyperfiddle

2025-05-19T01:14:49.073849Z

question about this form5 snippet: https://gist.github.com/yayitswei/e23f79dbf966c946452428db4e6db410 sometimes pressing the reset button works, but sometimes it doesn't. am i doing this right? or is there a race condition somewhere?

Geoffrey Gaillard 2025-05-19T09:09:29.208429Z

You need to use a https://electric.hyperfiddle.net/tutorial/token_explainer. Your https://gist.github.com/yayitswei/e23f79dbf966c946452428db4e6db410#file-minimal_editor_example-cljc-L19-L21 only runs once, on first button click. (pos? reset-counter) starts false and turns true on first button click, then stays true for subsequent button clicks. (reset! !form-data DEFAULT-VALUE) doesn’t rerun because neither !form-data nor DEFAULT-VALUE has changed.

2025-05-19T10:15:21.374989Z

thanks for interpreting my question and for the suggestion -- Token is just what i needed. will to try to more precise for future questions

Dustin Getz (Hyperfiddle) 2025-05-19T11:03:53.454449Z

it's not clear to me that he needs an out of band button with a manual Token, our forms demos bundle their buttons and don't have a userland token

2025-05-19T12:32:15.576139Z

I currently have the button outside of the form. I couldn't figure out how to use a Button! inside a Form! but probably a skill issue.

Dustin Getz (Hyperfiddle) 2025-05-19T12:37:13.428389Z

not a skill issue, the form bundles the button in our current structure

👀 1
Geoffrey Gaillard 2025-05-19T12:41:55.361809Z

> I couldn’t figure out how to use a Button! inside a Form! but probably a skill issue. I confirm this is not a skill issue. The API is not obvious, and we miss an example of custom Button! in forms.

🙏 1
Dustin Getz (Hyperfiddle) 2025-05-19T01:26:09.607649Z

i don't understand what you are trying to accomplish, please provide expected/actual behavior as well as the problem you are trying to solve

Dustin Getz (Hyperfiddle) 2025-05-19T01:29:07.995979Z

broadly, if you want a transactional form you should replicate one of the working demos exactly, forms are wip