4 ms·
> In order to create a list of stateful children, you must: This is trivially debunked: here is a 4,000 LoC open-source Elm SPA with small, type-safe reusable
by rtfeldman 9y ago
> In order to create a list of stateful children, you must:
This is trivially debunked: here is a 4,000 LoC open-source Elm SPA with small, type-safe reusable views that have state and don't do all this. :P
https://dev.to/rtfeldman/tour-of-an-open-source-elm-spa https://dev.to/rtfeldman/tour-of-an-open-source-elm-spa
Plenty of counterexamples in there.
Here's one. https://github.com/rtfeldman/elm-spa-example/blob/master/src/Views/User/Follow.elm https://github.com/rtfeldman/elm-spa-example/blob/master/src...
Here's another. https://github.com/rtfeldman/elm-spa-example/blob/master/src/Views/Errors.elm https://github.com/rtfeldman/elm-spa-example/blob/master/src...
Here's yet another. https://github.com/rtfeldman/elm-spa-example/blob/master/src/Views/Article.elm https://github.com/rtfeldman/elm-spa-example/blob/master/src...
- mistersys 9y agoThe parents of each of these elements have to manually map the state changes, they have to be aware of the internal state of the components, just as I was saying. Check this out: https://github.com/rtfeldman/elm-spa-example/blob/master/src/Page/Home.elm https://github.com/rtfeldman/elm-spa-example/blob/master/src... Go to the bottom, see how it manually maps the child events of the feed update? You have to duplicate that code for every single child component. All the other steps I described are there also.
- rtfeldman 9y agoAgain, there are lots of counterexamples to what you're claiming. The technique you're saying "must" be done in "every single" case came up a grand total of once in the entire code base: the file you linked to.
- deleted 9y ago[deleted]