luciodale / fork

A non-intrusive Clojurescript form management library for Re-frame and Reagent.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for server/remote calls without a submit

stevebuik opened this issue · comments

I want my form to send to server without a submit i.e. whenever valid changes are made. what’s your advice on how to do this? Currently I just fire a re-frame event in the validation fn but that seems a bit of an impure hack.

Idea: pass the up to date errors and touched to the send-server-request fn?

I added :errors, :touched, and :dirty args to the custom function passed to send-server-request in v2.0.4. :)

P.S. Never dispatch events during the rendering phase. Always link events to user-generated actions such as click events and so on to avoid very nasty bugs :).

Also, if you want to send events to the server frequently, consider calling send-server-request from the :on-blur event rather than :on-change... It might be better depending on your use case