[SuperEditor][SuperReader] - Move all components to accept view models instead of properties #2349
Labels
area_super_reader
Related to SuperReader
area_supereditor
Pertains to SuperEditor
bounty_junior
f:superlist
Funded by Superlist
time: 1
1hr or less
Creating a document component requires a process that begins with creating a view model from a document node, and then creating a widget from a view model.
Some of our document components directly accept an instance of their associated view model. Other components copy properties from their view model into the widget.
I think the reason that we initially copied individual properties is because view models are mutable. It would be a bug to alter a view model that's passed into a widget (because widgets are immutable).
However, our view model pipeline creates a final copy of a view model for each component builder. Therefore, in practice, the view model should never change out from under a component widget.
To reduce our work when creating components, and to maintain consistency in our approach, and to teach others a less verbose approach, change each document component widget to accept its corresponding view model instead of a bunch of properies.
The text was updated successfully, but these errors were encountered: