mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-05 12:57:33 +03:00
Simplify ContentCache.init function.
This commit is contained in:
parent
0a77ab5f04
commit
d22d2bebaf
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user