etaque/elm-transit/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Transit

Delayed model update for transition effects in Elm.

Types

type Action m

A type for transition steps

type Status
= Exiting
| Entering
| Entered

A type for the transition status

  • Exiting: model update scheduled
  • Entering: model update applied
  • Entered: transition finished
type alias WithTransition m =
{ m | transitStatus : Status }

An extensible record type containing the transition status

Updates

init : ModelUpdate m -> Time -> Effects (Action m)

Initialize the transition. The returned effect is carrying the exit action, holding the desired model update to be done and the transition delay (before and after the model update)

Action m
-> WithTransition m
-> ( WithTransition m, Effects (Action m) )

Update the transition status, and apply the desired model update when it's time to. Returns the updated model and the effect carrying the next transition action.

Helpers

statusName : WithTransition m -> String

Helper for the views: class name with CSS transition