On Wednesday, October 12, 2016 at 1:55:02 PM UTC+1, Peter Damoc wrote:
>
> I did however became aware of a big limitation to this approach: ports.
>
> ports seam to be needed in order to implement triggering events in order
> to communicate with the outside of the component.
>
I'll have to correct you here. The event is triggered by using an on-event
on the custom components html element:
onCountChanged : (Int -> msg) -> Attribute msg
onCountChanged tagger =
on "count-changed" <| Decode.map tagger detailCount
This is actually very neat, since ports are not needed.
But the port does need to be used to push the part of the state that the
component wants to make public from the Elm program, into the component as
javascript, so that it can trigger an on-event to pass it to the consumer
of the component.
> This limits the usefulness of the method because it bans the components
> from package.elm-lang.org.
>
> what do you think about this?
>
I think eventually package.elm-lang.org has to figure out its process for
bringing in new native stuff, but I understand the caution. Its not such a
problem for me right now as I'm interested in building and consuming my own
components, can push stuff out through github, and need to experiment with
stuff a lot more before anything is really releasable.
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.