Simplify ContentCache.init function.

This commit is contained in:
Dillon Kearns 2021-07-26 11:18:48 -07:00
parent 0a77ab5f04
commit d22d2bebaf

View File

@ -56,16 +56,12 @@ init :
Maybe ( Path, ContentJson )
-> ContentCache
init maybeInitialPageContent =
Dict.fromList []
|> (\dict ->
case maybeInitialPageContent of
Nothing ->
dict
case maybeInitialPageContent of
Nothing ->
Dict.empty
Just ( urls, contentJson ) ->
dict
|> Dict.insert urls (Parsed contentJson)
)
Just ( urls, contentJson ) ->
Dict.singleton urls (Parsed contentJson)
{-| Get from the Cache... if it's not already parsed, it will