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 ( Model, model, Action(Click), update
, flat, raised, fab, minifab, icon , flat, raised, fab, minifab, icon
, colored, primary, accent , colored, primary, accent
, View, State, Instance, instance, fwdClick , View, Container, Observer, Instance, instance, fwdClick
) where ) where
{-| From the [Material Design Lite documentation](http://www.getmdl.io/components/#buttons-section): {-| 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 @docs flat, raised, fab, minifab, icon
# Component # 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 = type alias Container c =
{ s | button : Indexed Model } { c | button : Indexed Model }
{-|
-}
type alias Observer obs = type alias Observer obs =
Component.Observer Action obs Component.Observer Action obs
{-| {-|
-} -}
type alias Instance state obs = type alias Instance container obs =
Component.Instance Component.Instance
Model Model container Action obs (List Style -> List Html -> Html)
state
Action
obs
(List Style -> List Html -> Html)
{-| Component instance. {-| Component instance.
-} -}
instance : instance :
Int Int
-> (Component.Action (State state) obs -> obs) -> (Component.Action (Container c) obs -> obs)
-> (Address Action -> Model -> List Style -> List Html -> Html) -> (Address Action -> Model -> List Style -> List Html -> Html)
-> Model -> Model
-> List (Observer obs) -> List (Observer obs)
-> Instance (State state) obs -> Instance (Container c) obs
instance id lift view model0 observers = instance id lift view model0 observers =
Component.instance Component.instance

View file

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