[{"name":"SubCmd","comment":" When setting up a submodule, you should use `SubCmd.cmd` when you want the submodule itself to handle the messages. However, if you want the message to be \"sent\" to the host, just use `SubCmd.effect`.\n\n    type alias Model =\n        { value : String }\n\n    type Msg\n        = FetchFromServer\n        | GotFromServer String\n        | Submit\n\n    type Effect\n        = SendValue String\n\n    update : Msg -> Model -> ( Model, SubCmd Msg Effect )\n    update msg model =\n        case msg of\n            FetchFromServer ->\n                ( model\n                , SubCmd.cmd (fetchFromServer GotFromServer)\n                )\n\n            GotFromServer value ->\n                ( { value = value }, SubCmd.none )\n\n            Submit ->\n                ( model, SubCmd.effect (SendValue model.value) )\n\n\n## Functions\n\n@docs SubCmd, none, cmd, effect, batch\n\n","unions":[],"aliases":[{"name":"SubCmd","comment":" ","args":["msg","effect"],"type":"SubModule.SubCmd.SubCmd msg effect"}],"values":[{"name":"batch","comment":" With batch you can actually send `cmd`'s and `effect`'s at the same time!\n\n    Submit ->\n        ( model, SubCmd.batch\n            [ SubCmd.effect (SendValue model.value)\n            , SubCmd.cmd (fetchFromServer GotFromServer)\n            ]\n        )\n\n","type":"List.List (SubCmd.SubCmd msg effect) -> SubCmd.SubCmd msg effect"},{"name":"cmd","comment":" ","type":"Platform.Cmd.Cmd msg -> SubCmd.SubCmd msg effect"},{"name":"effect","comment":" ","type":"effect -> SubCmd.SubCmd msg effect"},{"name":"none","comment":" ","type":"SubCmd.SubCmd msg effect"}],"binops":[]},{"name":"SubModule","comment":" This module is used for plugging submodules into a host module. If you're working on the submodule itself, check out `SubCmd`.\n\n@docs init, initWithEffect, update, updateWithEffect\n\n","unions":[],"aliases":[],"values":[{"name":"init","comment":" Enables you to initialize multiple submodules that **cannot send effects**.\n\n    let\n        ( subModule, initSubModule ) =\n            SubModule.init\n                |> SubModule.init SubModuleMsg\n\n        ( subModule2, initSubModule2 ) =\n            SubModule2.init\n                |> SubModule.init\n                    { toMsg = SubModule2Msg\n                    }\n    in\n    ( { subModule = subModule, subModule2 = subModule2 }, Cmd.none )\n        |> initSubModule\n        |> initSubModule2\n\n**This only exists so you can use a similar strategy across modules that do and don't send effects.** If you're only working with modules that don't you could just use this strategy:\n\n    let\n        ( subModule, subModuleCmd ) =\n            SubModule.init\n                |> Tuple.mapSecond (Cmd.map SubModuleMsg)\n\n        ( subModule2, subModule2Cmd ) =\n            SubModule2.init\n                |> Tuple.mapSecond (Cmd.map SubModule2Msg)\n    in\n    ( { subModule = subModule, subModule2 = subModule2 }\n    , Cmd.batch [ subModuleCmd, subModule2Cmd ]\n    )\n\n","type":"{ toMsg : subMsg -> msg } -> ( subModel, Platform.Cmd.Cmd subMsg ) -> ( subModel, ( model, Platform.Cmd.Cmd msg ) -> ( model, Platform.Cmd.Cmd msg ) )"},{"name":"initWithEffect","comment":" Enables you to initialize submodules that **can send effects**.\n\n    let\n        -- This submodule can't send effects\n        ( subModule, initSubModule ) =\n            SubModule.init\n                |> SubModule.init\n                    { toMsg = GotSubMsg\n                    }\n\n        -- But this one can!\n        ( subModule2, initSubModule2 ) =\n            SubModule2.init\n                |> SubModule.initWithEffect\n                    { toMsg = GotSubMsg2\n                    , effectToMsg = GotSubEffect2\n                    }\n    in\n    ( { subModule = subModule\n      , subModule2 = subModule2\n      }\n    , Cmd.none\n    )\n        |> initSubModule\n        |> initSubModule2\n\n","type":"{ toMsg : subMsg -> msg, effectToMsg : subEffect -> msg } -> ( subModel, SubModule.SubCmd.SubCmd subMsg subEffect ) -> ( subModel, ( model, Platform.Cmd.Cmd msg ) -> ( model, Platform.Cmd.Cmd msg ) )"},{"name":"update","comment":" Enables you to handle the updates of submodules that **cannot send effects**.\n\n    type Msg\n        = GotSubMsg SubWidget.Msg\n        | ...\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            GotSubMsg subMsg ->\n                SubModule.update subMsg model.subModule\n                    |> SubModule.update\n                        { toMsg = GotSubMsg\n                        , toModel = \\subModule -> { model | subModule = subModule }\n                        }\n            ...\n\n**This only exists so you can use a similar strategy across modules that do and don't send effects.** If you're only working with modules that don't you could just use this strategy:\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            GotSubMsg subMsg ->\n                SubModule.update subMsg model.subModule\n                    |> SubModule.update\n                        |> Tuple.mapFirst \\subModule -> { model | subModule = subModule }\n                        |> Tuple.mapSecond (Cmd.map GotSubMsg)\n            ...\n\n","type":"{ toModel : subModel -> model, toMsg : subMsg -> msg } -> ( subModel, Platform.Cmd.Cmd subMsg ) -> ( model, Platform.Cmd.Cmd msg )"},{"name":"updateWithEffect","comment":" Enables you to handle the updates of submodules that **can send effects**.\n\n    type Msg\n        = GotSubMsg SubWidget.Msg\n        | GotSubEffect SubWidget.Effect\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            GotSubMsg subMsg ->\n                SubWidget.update subMsg model.subModel\n                    |> SubWidget.updateWithEffect\n                        { toMsg = GotSubMsg\n                        , effectToMsg = GotSubEffect\n                        , toModel =\n                            \\subModel -> { model | subModel = subModel }\n                        }\n\n            GotSubEffect subEffect ->\n                case subEffect of\n                    SubWidget.SendValue value ->\n                        ( { model | subValue = Just value }\n                        , Cmd.none\n                        )\n\n","type":"{ toModel : subModel -> model, toMsg : subMsg -> msg, effectToMsg : subEffect -> msg } -> ( subModel, SubModule.SubCmd.SubCmd subMsg subEffect ) -> ( model, Platform.Cmd.Cmd msg )"}],"binops":[]}]