This is exactly what it is.

It takes a value and a list and returns a tuple with the value and the
command resulted from batching that list.

I used to have a similar function back in 0.16 days

noFx model = (model, Effects.none)

and I would have used it like

SomeAction ->
    noFx {model |...}

because I liked it better than

SomeAction ->
    ({model | ... }, Effects.none)

but this new way is way better.

If you don't have Cmd to return, you just leave the list empty and if you
do have some Cmds (e.g. from children updates) you can just add them in the
list.




On Mon, May 16, 2016 at 5:09 AM, Nandiin Bao <[email protected]> wrote:

> I've looked at compiled javascript code and it's saying something like
> this :
>
> (!) = (\model list -> (model, Cmd.batch list))
>
>
> 在 2016年5月16日星期一 UTC+8上午6:21:18,Peter Bruinsma写道:
>
>> For example, in TodoMVC:
>>
>> init : Maybe Model -> ( Model, Cmd Msg )
>> init savedModel =
>>   Maybe.withDefault emptyModel savedModel ! []
>>
>>
>>
>>
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to