Re-named State -> Container

This commit is contained in:
Søren Debois 2016-04-10 21:52:21 +02:00
parent 4e9b8e6746
commit e5b71fde06
2 changed files with 18 additions and 20 deletions

View file

@ -2,7 +2,7 @@ module Material.Button
( Model, model, Action(Click), update
, flat, raised, fab, minifab, icon
, colored, primary, accent
, View, State, Instance, instance, fwdClick
, View, Container, Observer, Instance, instance, fwdClick
) where
{-| From the [Material Design Lite documentation](http://www.getmdl.io/components/#buttons-section):
@ -40,7 +40,7 @@ for details about what type of buttons are appropriate for which situations.
@docs flat, raised, fab, minifab, icon
# Component
@docs State, Instance, instance, fwdClick
@docs Container, Observer, Instance, instance, fwdClick
-}
@ -261,34 +261,32 @@ icon = view "mdl-button--icon"
{-|
-}
type alias State s =
{ s | button : Indexed Model }
type alias Container c =
{ c | button : Indexed Model }
{-|
-}
type alias Observer obs =
Component.Observer Action obs
{-|
-}
type alias Instance state obs =
type alias Instance container obs =
Component.Instance
Model
state
Action
obs
(List Style -> List Html -> Html)
Model container Action obs (List Style -> List Html -> Html)
{-| Component instance.
-}
instance :
Int
-> (Component.Action (State state) obs -> obs)
-> (Component.Action (Container c) obs -> obs)
-> (Address Action -> Model -> List Style -> List Html -> Html)
-> Model
-> List (Observer obs)
-> Instance (State state) obs
-> Instance (Container c) obs
instance id lift view model0 observers =
Component.instance

View file

@ -30,7 +30,7 @@ This implementation provides only single-line.
@docs Action, Model, model, update, view
# Component
@docs State, Instance
@docs Container, Instance
@docs instance, fwdInput, fwdBlur, fwdFocus
-}
@ -76,7 +76,7 @@ type Kind
-}
{-| Model. The textfield is in its error-state if `error` is not `Nothing`.
{-| Model. The textfield is in its error-container if `error` is not `Nothing`.
The contents of the field is `value`.
-}
type alias Model =
@ -179,24 +179,24 @@ view addr model =
{-|
-}
type alias State state =
{ state | textfield : Indexed Model }
type alias Container c =
{ c | textfield : Indexed Model }
{-|
-}
type alias Instance state obs =
Component.Instance Model state Action obs Html
type alias Instance container obs =
Component.Instance Model container Action obs Html
{-| Component constructor. See module `Material`.
-}
instance :
Int
-> (Component.Action (State state) obs -> obs)
-> (Component.Action (Container c) obs -> obs)
-> Model
-> List (Component.Observer Action obs)
-> Instance (State state) obs
-> Instance (Container c) obs
instance =
let