1module Effect exposing (Effect(..), batch, fromCmd, map, none, perform)
5@docs Effect, batch, fromCmd, map, none, perform
9import Browser.Navigation
12import Json.Decode as Decode
14import Url exposing (Url)
21 | Batch (List (Effect msg))
22 | GetStargazers (Result Http.Error Int -> msg)
23 | SetField { formId : String, name : String, value : String }
25 { data : Maybe FormData
26 , toMsg : Result Http.Error Url -> msg
30 , toMsg : Result Http.Error Url -> msg
32 | SubmitFetcher (Pages.Fetcher.Fetcher msg)
36type alias RequestInfo =
37 { contentType : String
49batch : List (Effect msg) -> Effect msg
55fromCmd : Cmd msg -> Effect msg
61map : (a -> b) -> Effect a -> Effect b
71 Batch (List.map (map fn) list)
73 GetStargazers toMsg ->
74 GetStargazers (toMsg >> fn)
76 FetchRouteData fetchInfo ->
78 { data = fetchInfo.data
79 , toMsg = fetchInfo.toMsg >> fn
84 { values = fetchInfo.values
85 , toMsg = fetchInfo.toMsg >> fn
91 SubmitFetcher fetcher ->
93 |> Pages.Fetcher.map fn
100 { data : Maybe FormData
101 , toMsg : Result Http.Error Url -> pageMsg
106 , toMsg : Result Http.Error Url -> pageMsg
110 Pages.Fetcher.Fetcher pageMsg
112 , fromPageMsg : pageMsg -> msg
113 , key : Browser.Navigation.Key
114 , setField : { formId : String, name : String, value : String } -> Cmd msg
118perform ({ fromPageMsg, key } as helpers) effect =
124 Cmd.map fromPageMsg cmd
127 helpers.setField info
130 Cmd.batch (List.map (perform helpers) list)
132 GetStargazers toMsg ->
135 "https://api.github.com/repos/dillonkearns/elm-pages"
136 , expect = Http.expectJson (toMsg >> fromPageMsg) (Decode.field "stargazers_count" Decode.int)
139 FetchRouteData fetchInfo ->
140 helpers.fetchRouteData
144 helpers.submit record
146 SubmitFetcher record ->
147 helpers.runFetcher record
151 { fields : List ( String, String )
152 , method : Form.Method
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list