mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-24 04:12:09 +03:00
Add some additional types in generated code.
This commit is contained in:
parent
f1ce6bdc54
commit
5f8367478d
@ -510,9 +510,9 @@ otherFile routes phaseString =
|
|||||||
}
|
}
|
||||||
subscriptions =
|
subscriptions =
|
||||||
Elm.Declare.fn3 "subscriptions"
|
Elm.Declare.fn3 "subscriptions"
|
||||||
( "route", Nothing )
|
( "route", Type.named [ "Route" ] "Route" |> Type.maybe |> Just )
|
||||||
( "path", Nothing )
|
( "path", Type.named [ "Path" ] "Path" |> Just )
|
||||||
( "model", Nothing )
|
( "model", Type.named [] "Model" |> Just )
|
||||||
(\route path model ->
|
(\route path model ->
|
||||||
Gen.Platform.Sub.batch
|
Gen.Platform.Sub.batch
|
||||||
[ Elm.apply
|
[ Elm.apply
|
||||||
@ -530,6 +530,7 @@ otherFile routes phaseString =
|
|||||||
|> Gen.Platform.Sub.call_.map (Elm.val "MsgGlobal")
|
|> Gen.Platform.Sub.call_.map (Elm.val "MsgGlobal")
|
||||||
, templateSubscriptions.call route path model
|
, templateSubscriptions.call route path model
|
||||||
]
|
]
|
||||||
|
|> Elm.withType (Gen.Platform.Sub.annotation_.sub (Type.named [] "Msg"))
|
||||||
)
|
)
|
||||||
|
|
||||||
onActionData :
|
onActionData :
|
||||||
@ -617,6 +618,7 @@ otherFile routes phaseString =
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|> Elm.withType (Gen.Platform.Sub.annotation_.sub (Type.named [] "Msg"))
|
||||||
)
|
)
|
||||||
|
|
||||||
dataForRoute :
|
dataForRoute :
|
||||||
@ -1232,22 +1234,25 @@ otherFile routes phaseString =
|
|||||||
, value : List String -> Elm.Expression
|
, value : List String -> Elm.Expression
|
||||||
}
|
}
|
||||||
fooFn =
|
fooFn =
|
||||||
{-
|
|
||||||
fooFn :
|
|
||||||
(a -> PageModel)
|
|
||||||
-> (b -> Msg)
|
|
||||||
-> Model
|
|
||||||
-> ( a, Effect.Effect b, Maybe Shared.Msg )
|
|
||||||
-> ( PageModel, Effect.Effect Msg, ( Shared.Model, Effect.Effect Msg ) )
|
|
||||||
fooFn wrapModel wrapMsg model triple =
|
|
||||||
Debug.todo ""
|
|
||||||
|
|
||||||
-}
|
|
||||||
Elm.Declare.fn4 "fooFn"
|
Elm.Declare.fn4 "fooFn"
|
||||||
( "wrapModel", Nothing )
|
( "wrapModel"
|
||||||
( "wrapMsg", Nothing )
|
, Type.function [ Type.var "a" ]
|
||||||
|
(Type.named [] "PageModel")
|
||||||
|
|> Just
|
||||||
|
)
|
||||||
|
( "wrapMsg"
|
||||||
|
, Type.function [ Type.var "b" ]
|
||||||
|
(Type.named [] "Msg")
|
||||||
|
|> Just
|
||||||
|
)
|
||||||
( "model", Type.named [] "Model" |> Just )
|
( "model", Type.named [] "Model" |> Just )
|
||||||
( "triple", Nothing )
|
( "triple"
|
||||||
|
, Type.triple
|
||||||
|
(Type.var "a")
|
||||||
|
(Type.namedWith [ "Effect" ] "Effect" [ Type.var "b" ])
|
||||||
|
(Type.maybe (Type.named [ "Shared" ] "Msg"))
|
||||||
|
|> Just
|
||||||
|
)
|
||||||
(\wrapModel wrapMsg model triple ->
|
(\wrapModel wrapMsg model triple ->
|
||||||
Elm.Case.custom triple
|
Elm.Case.custom triple
|
||||||
Type.unit
|
Type.unit
|
||||||
@ -1287,6 +1292,14 @@ otherFile routes phaseString =
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|> Elm.withType
|
||||||
|
(Type.triple
|
||||||
|
(Type.named [] "PageModel")
|
||||||
|
(Type.namedWith [ "Effect" ] "Effect" [ Type.named [] "Msg" ])
|
||||||
|
(Type.tuple (Type.named [ "Shared" ] "Model")
|
||||||
|
(Type.namedWith [ "Effect" ] "Effect" [ Type.named [ "Shared" ] "Msg" ])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
toTriple :
|
toTriple :
|
||||||
|
Loading…
Reference in New Issue
Block a user