@@ -13,7 +13,7 @@ type alias Stream =
13
13
14
14
15
15
type alias Model a =
16
- { searchedStream : Stream
16
+ { stream : Stream
17
17
, onSelectMsg : Stream -> a
18
18
}
19
19
@@ -35,7 +35,7 @@ emptyStreams =
35
35
36
36
init : (Stream -> a ) -> Model a
37
37
init onSelectMsg =
38
- { searchedStream = emptyStreamName
38
+ { stream = emptyStreamName
39
39
, onSelectMsg = onSelectMsg
40
40
}
41
41
@@ -49,24 +49,24 @@ update : Msg -> Model a -> ( Model a, Cmd a )
49
49
update msg model =
50
50
case msg of
51
51
StreamChanged stream ->
52
- ( { model | searchedStream = stream }, Cmd . none )
52
+ ( { model | stream = stream }, Cmd . none )
53
53
54
54
GoToStream stream ->
55
- ( { model | searchedStream = emptyStreamName }
55
+ ( { model | stream = emptyStreamName }
56
56
, onSelectCmd model. onSelectMsg stream
57
57
)
58
58
59
59
60
60
view : Model a -> Html Msg
61
61
view model =
62
- form [ onSubmit ( GoToStream model. searchedStream ) ]
62
+ form [ onSubmit ( GoToStream model. stream ) ]
63
63
[ div [ class " relative" ]
64
64
[ FeatherIcons . search
65
65
|> FeatherIcons . withClass " size-4 text-gray-400 absolute pointer-events-none top-3.5 left-2"
66
66
|> FeatherIcons . toHtml []
67
67
, input
68
68
[ class " rounded text-gray-800 cursor-pointer pl-8 pr-12 py-2 w-full appearance-none outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50"
69
- , value model. searchedStream
69
+ , value model. stream
70
70
, onInput StreamChanged
71
71
, placeholder " Quick search…"
72
72
, autofocus True
0 commit comments