Re:Why Elm? [pdf]
by kureikain on Wednesday May 10, 2017 @12:56PM
(#14309681)
I really like Elm. It makes writing code so easier. At first, it's bit hard to get into the habit. But once I got paste that state(that takes 1-2 days) and get into how to write Elm, everything become so clear.
I currently use Rails and this helper[1] to render an Elm component. Then I mount it like this: [2]
I currently use Rails and this helper[1] to render an Elm component. Then I mount it like this: [2]
``` <%= elm_component('TeamPicker', {flags: { formAuthenticityToken: form_authenticity_token, domain: current.domain, teams: user.my_teams.map { |team| {id: team.id.to_s, name: team.name || ""} }, current_team: {id: current.team.id.to_s, name: current.team.name || ""} }}, {tag: 'div', class: "nav-item"}) %> ```
I think this is an easy way to get into Elm world step by step.
My site is still normal HTML but I used ELM here and there for some component require interaction/multi step form etc.
---
[1]: https://github.com/NotyIm/trinity/blob/master/app/helpers/el... [2]: https://github.com/NotyIm/trinity/blob/master/app/views/part...