re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
jmckitrick 2020-11-27T14:33:42.384300Z

What’s the best approach to a re-frame form edit widget where some of the fields must be rendered from custom objects, like date/time or a money field?

jmckitrick 2020-11-30T14:50:51.388500Z

Well, I thought perhaps it would be easier to deal with one format vs another on the js side. The transit format is great for over the wire, but other types might be better for JS side manipulation. Since I'm new to the transit types, I'm still figuring this out....

p-himik 2020-11-30T15:23:08.388700Z

Ah, right. Personally, I'm fine with the types that Transit supports. And when I'm not (like it can be with #inst), it's fairly easy to redefine the default read/write handlers to support custom types that you seem as more fit. You don't need to convert the data manually everywhere.

p-himik 2020-11-27T14:40:15.384700Z

I don't understand what you mean by "be rendered from custom objects". But maybe you can get some ideas from some of the re-com widgets.

jmckitrick 2020-11-27T14:43:23.384900Z

Hmm, ok I’ll take a look.

jmckitrick 2020-11-27T14:44:07.385100Z

I’m just referring to js objects that need to be formatted in a form field, since they aren’t simple strings or numbers.

jmckitrick 2020-11-27T14:44:28.385300Z

So, when to convert them, where to keep the state, when to convert back, etc.

p-himik 2020-11-27T14:58:24.385500Z

I think it's somewhat obvious: > when to convert them Exactly when you need the converted value. > where to keep the state Where you usually keep the state when you have to deal with just strings and numbers. > when to convert back When you need to update the state.