-
Hi - in the Todo app you have split out various views, but they are part of the single component, i.e. the update and state aren't split out. I know Elm "has views" on components, and this flattened "all in one" style should sensibly be the default, but for a very large app it makes sense to split out reusable components and discrete components. Are there any examples where this is demonstrated or is it not possible? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can do it however you want. You can split it or not just like how you decide to write your functions. The function The |
Beta Was this translation helpful? Give feedback.
You can do it however you want. You can split it or not just like how you decide to write your functions. The function
view
is needed to be implemented in the your component as it needs to implement theComponent
trait. The otherview_<specific>
functions which are parts of the main view function will need to be implemented in your bare component that is not part of theimpl Component for <your_component>
.The
minimal
and other simple examples demonstrate the use of only oneview
while other examples such as thetodo
andwindow-tab-rows
demonstrate the use ofview
function being split into view of other details/fields contained in the component struct.