Skip to content

Instantly share code, notes, and snippets.

@chalmagean
Created April 14, 2016 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chalmagean/5f77692037eaef9dc41590bd9fc25701 to your computer and use it in GitHub Desktop.
Save chalmagean/5f77692037eaef9dc41590bd9fc25701 to your computer and use it in GitHub Desktop.
type Action
= NoOp
| UpdateProtein String
view : Signal.Address Action -> Model -> Html
view address model =
div [] [
div [] [
input
[ type' "text"
, placeholder "Protein"
, myInput address UpdateProtein
] []
]
]
myInput : Signal.Address a -> Action -> Attribute
myInput address action =
on "input" targetValue (\value -> Signal.message address (action value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment