Skip to content

Instantly share code, notes, and snippets.

@r00k
Created April 8, 2016 19:56
Show Gist options
  • Save r00k/fdde5d6a9eb9cfd150ad58ea301e15c3 to your computer and use it in GitHub Desktop.
Save r00k/fdde5d6a9eb9cfd150ad58ea301e15c3 to your computer and use it in GitHub Desktop.
module Util.CustomEvent (onSubmit) where
import Html exposing (..)
import Html.Events exposing (onWithOptions, defaultOptions)
import Json.Decode exposing (value)
onSubmit : Signal.Address a -> a -> Attribute
onSubmit addr msg =
onWithOptions
"submit"
{ defaultOptions | preventDefault = True }
value
(\_ -> Signal.message addr msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment