mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-19 11:41:32 +03:00
Refactor to make how we're finding the given doodad more clear
This commit is contained in:
parent
c41eab81e8
commit
455ffb3796
@ -180,12 +180,14 @@ view model =
|
||||
view_ : Model -> Html Msg
|
||||
view_ model =
|
||||
let
|
||||
examples filterBy =
|
||||
List.filter (\m -> filterBy m) (Dict.values model.moduleStates)
|
||||
findExampleByName name =
|
||||
Dict.values model.moduleStates
|
||||
|> List.filter (\m -> m.name == name)
|
||||
|> List.head
|
||||
in
|
||||
case model.route of
|
||||
Routes.Doodad doodad ->
|
||||
case List.head (examples (\m -> m.name == doodad)) of
|
||||
case findExampleByName doodad of
|
||||
Just example ->
|
||||
viewExample model example
|
||||
|> Html.map (UpdateModuleStates example.name)
|
||||
|
Loading…
Reference in New Issue
Block a user