This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0
A library for sending Mixpanel events
version 2.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 2.0.0
Committed At 2018-01-12 11:57:08 UTC
truqu/elm-base64 2.0.1 <= v < 3.0.0 2.0.4
elm-lang/http 1.0.0 <= v < 2.0.0 1.0.0
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

elm-mixpanel

Pure Elm library for sending events to Mixpanel and tracking profiles.

type alias Model =
    { config : Mixpanel.Config
    , userId : String
    }

type Msg = NoOp | Save String

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        Save item ->
            { model | items = item :: items }
            ! [ do <| Mixpanel.track model.config
                    { event = "Saved"
                    , properties = [ ("distinct_id", Json.Encode.string model.userId ) ]
                    }
              , do <| Mixpanel.peopleAppend model.config
                    { distinctId = model.userId }
                    [ ( "Items", Json.Encode.string item ) ]
              ]

        NoOp -> model ! []

do : Task a e -> Cmd Msg
do task =
    Task.attempt (\_ -> NoOp) task