Yeah, I’m thinking of adding that version of perform to a task-extra package. Actually wondering about the name. Maybe performUnfailing, because the standard perform is not really “unsafe” either.
2016-05-24 13:17 GMT+02:00 Peter Damoc <[email protected]>: > I would love to have `never` in core and available on elm-lang.org/try > > Or have > > performSafe: (a -> Cmd msg) -> Task Never a -> Cmd msg > > Until then, I prefer the universality of NoOp. > > > > > > On Tue, May 24, 2016 at 12:49 PM, Janis Voigtländer < > [email protected]> wrote: > >> My standard objection: >> >> Replace Task.perform (\_ -> NoOp) by Task.perform never, using: >> >> >> http://package.elm-lang.org/packages/elm-community/basics-extra/1.0.0/Basics-Extra#never >> >> >> 2016-05-24 11:21 GMT+02:00 Peter Damoc <[email protected]>: >> >>> You should use Process.sleep >>> >>> dismissCmd = >>> Process.sleep (2 * second) >>> |> Task.perform (\_ -> NoOp) (\_ -> DismissAlert) >>> >>> >>> >>> On Tue, May 24, 2016 at 11:56 AM, TheGryzor123 <[email protected]> >>> wrote: >>> >>>> I'm still pretty new to Elm so I prefer to ask. >>>> >>>> I'm creating a typical alert that says "Action successful!" and want it >>>> to disappear automatically after 5 seconds. >>>> >>>> Should I use Time.every for that? >>>> >>>> -- >>>> 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. >>> >> >> -- >> 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. > -- 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.
