Javascript to Elm

28: Ports Multiplying

Informações:

Synopsis

  Extra Type Alias I had made a type alias Notes = List Note Mostly because the compiler was complaining at one point, and I wasn’t able to see to distill from it that all I needed was some parentheses around List Note to disambiguate it. Tackling the onClick event List.map (\n -> Listgroup.li [ onClick (routeTo "/notes/" ++ n.noteId) ] [ text n.content ]) notes that was my first thought, but.. The 1st argument to function `li` is causing a mismatch. - Function `li` is expecting the 1st argument to be: List (Listgroup.ItemOption msg) But it is: List (Html.Attribute a) grrrrrr List (Html.Attribute msg) But the right side is: Html.Attribute Msg What I finally got Listgroup.button [ Listgroup.attrs { ports.fetchNotes.subscribe(path => { invokeApig({ path: path, queryParams: { limit: 5 } }) .then(results => ports.notesLoaded.send(results)) .catch(e => console.log(e)); }); ports.routeTo.subscribe(url => { this.props.history.push(ur