Skip to content

ahstro/elm-konami-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elm-konami-code

Use the Konami Code to do awesome (or boring) stuff on your website.

Installation

elm-package install ahstro/elm-konami-code

Usage

import KonamiCode exposing (KonamiCode)

type alias Model =
    { konamiCode : KonamiCode
    }

type Msg
    = KonamiCodeMsg KonamiCode.Msg

init : ( Model, Cmd Msg )
init =
    ( { konamiCode = KonamiCode.init }
    , Cmd.none
    )

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        KonamiCodeMsg msg ->
            let
                ( newModel, konamiCodeEntered ) =
                    KonamiCode.update msg model
            in
            ( { newModel
                | showEasterEgg =
                    model.showEasterEgg || konamiCodeEntered
              }
            , Cmd.none
            )

subscriptions : Model -> Sub Msg
subscriptions model =
    KonamiCode.subscribe KonamiCodeMsg

About

Use the Konami Code to do awesome (or boring) stuff on your website.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages