andrewhathaway / Winterfell

Generate complex, validated and extendable JSON-based forms in React.
http://winterfell.andrewhathaway.net
MIT License
785 stars 116 forks source link

A Way to get all choices? #74

Closed christopher-wilson closed 7 years ago

christopher-wilson commented 8 years ago

Being based on React, there could be a way to retrieve the choices as a single parsible object. I don't know if this would require using one of the data store libraries, or just creating an object with nested data.

It would be incredibly useful to have something, either way.

andrewhathaway commented 7 years ago

Hi @christopher-wilson. Apologies for the late response, this must have slipped away. Which "choices" are you speaking of exactly? More information would be helpful! Thanks.

christopher-wilson commented 7 years ago

It would be nice to have a way to return all the options in an object. Say you build a form, and you submit, it would be great to generate an object with all the data we selected. Parsing the data was difficult last time I looked.

Maybe if there were an object that data was stored to as we went through our forms, like a root data object that you see in React or Vue sometimes.

andrewhathaway commented 7 years ago

@christopher-wilson If you're talking about the results from the form, the events section of the README includes information with passing callbacks when a question is answered or the entire form is submitted. Each one returns the object containing the users answers.

Hope this helps!