Rename DataSource.Port.send -> DataSource.Port.get.

This commit is contained in:
Dillon Kearns 2021-07-30 14:33:28 -07:00
parent 63667f3e65
commit 731bea779b
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@ type alias Timestamps =
data : String -> DataSource Timestamps
data filePath =
DataSource.Port.send "gitTimestamps"
DataSource.Port.get "gitTimestamps"
(Json.Encode.string filePath)
(Decode.string
|> Decode.map (String.trim >> String.split "\n")

View File

@ -1,8 +1,8 @@
module DataSource.Port exposing (send)
module DataSource.Port exposing (get)
{-|
@docs send
@docs get
-}
@ -74,8 +74,8 @@ prefer to add ANSI color codes within the error string in an exception and it wi
As with any JavaScript or NodeJS code, avoid doing blocking IO operations. For example, avoid using `fs.readFileSync`, because blocking IO can slow down your elm-pages builds and dev server.
-}
send : String -> Json.Encode.Value -> Decoder b -> DataSource.DataSource b
send portName input decoder =
get : String -> Json.Encode.Value -> Decoder b -> DataSource.DataSource b
get portName input decoder =
DataSource.Http.request
(Secrets.succeed
{ url = "port://" ++ portName