I'm experimenting a little with Elm. Right now I have several input range on the screen and I want to control individually their values, but I don't know how to distinct between them (in Js I would send the ID and the VALUE of the input on the onInput callback) since I only can send ONE argument with the Elm's onInput
inp : Input -> Html Msg
inp inp =
div [ class "input" ]
[ p [] [ text inp.name ]
, input [ id (toString inp.id), type' "range", value inp.volume, onInput ChangeInput ] []
, controls inp.name inp.id
]
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
Play id ->
( play model id, Cmd.none )
ChangeInput id value ->
-- Here I want to grab the id and the value coming from the input --
NoOp ->
( model, Cmd.none )
Any help? Thanks!!