Skip to content

Commit da3a16d

Browse files
fix(http-server): return command instead of task
Stream.sendLine returns a "Task x {}", but the type signture requires "Cmd msg".
1 parent 3adc9f2 commit da3a16d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

http-server/src/Main.gren

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ update msg model =
5656
case result of
5757
Ok server ->
5858
{ model = { model | server = Just server }
59-
, command = Stream.sendLine model.stdout
60-
"Server started"
59+
, command =
60+
Stream.sendLine model.stdout "Server started"
61+
|> Task.execute
6162
}
6263
Err (ServerError code message) ->
6364
{ model = model
64-
, command = Stream.sendLine model.stderr <|
65-
"Server failed to start: " ++ code ++ "\n" ++ message
65+
, command =
66+
Stream.sendLine model.stderr ("Server failed to start: " ++ code ++ "\n" ++ message)
67+
|> Task.execute
6668
}
6769

6870
GotRequest req res ->

0 commit comments

Comments
 (0)