marcaaron / yes-on-1600

Yes on 1600 / Whole Washington / Health Insurance Calculator
https://wholewashington.nationbuilder.com/ww_savings_estimator
5 stars 7 forks source link

Dynamically generate state for dev supplied user input variables. #14

Open marcaaron opened 6 years ago

marcaaron commented 6 years ago

This issue concerns the viability of this project outside it's current scope and the potential for white-label use down the line.

Currently questions are supplied via the questions.js file and take the form of an array. User inputs are handled in the App.js state and pushed to another array called vars. Ideally we'd want each form to have it's own declared variable name and not be generally held in the vars array since currently if any changes are made to the questions array those changes will impact the rendering of results and variable names declared in any calculator functions will need to be updated accordingly

e.g. const premium = this.props.vars[index] - index would need to change if the index of our premium question changes.