Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 282 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
282
Dung lượng
1,24 MB
Nội dung
elm @rtfeldman JavaScript Interop function guarantees same arguments? same return value no side effects Math.random() localStorage.foo = "bar"; access huge JS ecosystem access huge JS ecosystem while maintaining guarantees "client/server" communication "client/server" communication Elm sends data to JS JS sends data to Elm how we get this? update Model view Elm Runtime keep updating model and running commands don't bother running view until the next repaint This is just how Elm rolls update Model view Elm Runtime keep updating model and running commands don't bother running view until the next repaint don't count on Debug.log in views! Exercise: resolve the TODOs in part13 Debug.log "foo is" foo lazy 13 Tools HTML-to-Elm JSON-to-Elm sample JSON Error Message Catalog create-elm-app elm-format elm-reactor elm-css Links of Interest Built With Elm: builtwithelm.co Elm Community: elm-community.org NRI Tech Blog: tech.noredink.com Exercise: resolve the TODO in ElmHubCss.elm package.elm-lang.org/packages/rtfeldman/elm-css/latest ElmHub Hacking! Refactor to results : Dict Int SearchResult Move SearchOptions into its own module Migrate tests from part9 to part14 and add tests for update Implement additional search options: https://developer.github.com/v3/search/#search-repositories ... "client/server" communication Elm sends data to JS JS sends data to Elm "client/server" communication Elm sends data to JS JS sends data to Elm no direct function calls Cmd on the Elm side callback on... : Html Msg elmHubHeader = header [] [ h1 [] [ text "ElmHub" ] , span [ class "tagline" ] [ text "Like GitHub " ] ] elmHubHeader : Html msg elmHubHeader = header [] [ h1 [] [ text "ElmHub" ] ,... List a elmHubHeader : Html Msg elmHubHeader = header [] [ h1 [] [ text "ElmHub" ] , span [ class "tagline" ] [ text "Like GitHub " ] ] "this is compatible with Html that produces Msg" elmHubHeader