Clojurians
#re-frame
<
2016-06-23
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

lwhorton13:06:31

is there a way to avoid writing a -ton- of handlers when dealing with large forms? i.e. i have 2x date inputs, 5x text inputs, and a few others — and one single slice of state {:form {:date-1 x :date-2 x :input-1 x… }}. Each obviously takes an on-change, but rather than writing dispatch [:form/date-1-changed %1] over and over, could I just do [:form/changed (get-value-of-whole-form)] somehow?

sbmitchell14:06:56

I think that is up to your discretion

sbmitchell14:06:06

I would probably just do :form/changed keyword value

sbmitchell14:06:15

instead of a dispatch for each individual keyword

sbmitchell14:06:20

that seems like overkill

mikethompson22:06:55

@lwhorton: or perhaps you (dispatch [:form-changed :form-item-id new-value-for-that-item]) then all form item updates go to the one handler