New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics.Input documentation's examples use Signal.Channel #250

Closed
jconti opened this Issue May 21, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@jconti

jconti commented May 21, 2015

Being new to elm I like the code examples in the docs a bunch. Some code in Graphics.Input is out of date however. I wonder if this:

type Keys = Number Int | Plus | Minus | Clear

keys : Signal.Channel Keys
keys = Signal.channel Clear

calculator : Element
calculator =
    flow right
      [ button (Signal.send keys (Number 1)) "1"
      , button (Signal.send keys (Number 2)) "2"
      , button (Signal.send keys    Plus   ) "+"
      ]

should look like:

import Signal
import Graphics.Element exposing (..)
import Graphics.Input exposing (..)

type Keys = Number Int | Plus | Minus | Clear

keys : Signal.Mailbox Keys
keys = Signal.mailbox Clear

calculator : Element
calculator =
    flow right
      [ button (Signal.message keys.address (Number 1)) "1"
      , button (Signal.message keys.address (Number 2)) "2"
      , button (Signal.message keys.address     Plus   ) "+"
      ]
main = calculator
@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender May 21, 2015

Contributor

Already fixed: https://github.com/elm-lang/core/issues/231 (just not yet released).

Contributor

jvoigtlaender commented May 21, 2015

Already fixed: https://github.com/elm-lang/core/issues/231 (just not yet released).

@jconti

This comment has been minimized.

Show comment
Hide comment
@jconti

jconti May 22, 2015

Splendid. Thank you.

jconti commented May 22, 2015

Splendid. Thank you.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Jun 4, 2015

Contributor

I think this issue can be closed.

Contributor

jvoigtlaender commented Jun 4, 2015

I think this issue can be closed.

@mgold

This comment has been minimized.

Show comment
Hide comment
@mgold

mgold Jun 11, 2015

Contributor

New docs are out and this should be resolved.

Contributor

mgold commented Jun 11, 2015

New docs are out and this should be resolved.

@evancz evancz closed this Jun 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment