Skip to content

Consider adding broadcast #145

Description

@sorvell

Sometimes a custom elements wants to give its descendants some generic information which they may, optionally, respond to.

This is very much like an event, but it's sent downward to children.

Activity

  1. RenaudF commented on Jun 16, 2014

    @RenaudF

    +1, see this SO question

  2. peterwmwong commented on Jun 16, 2014

    @peterwmwong
    Contributor

    +1

  3. robdodson commented on Jun 16, 2014

    @robdodson
    Contributor

    I posted a response to the SO question. I think @sorvell might be describing a one-way message passing system which only flows to an element's children, whereas the SO thread seems to want PubSub.

  4. RenaudF commented on Jun 16, 2014

    @RenaudF

    Without going as far as full pubsub implementation, a simple broadcast or event bus capability would go a long way. The solution you linked to does the trick perfectly, I should start having a look at those articles (no clues in the API section). Shouldn't that polymer-signals element be part of the core, just as core-ajax ?

  5. robdodson commented on Jun 16, 2014

    @robdodson
    Contributor

    Yep, we're discussing it. Thread to follow is here:
    googlearchive/polymer-signals#3

    On Mon, Jun 16, 2014 at 9:17 AM, Renaud Fontana notifications@github.com
    wrote:

    Without going as far as full pubsub implementation, a simple broadcast or
    event bus capability would go a long way. The solution you linked to does
    the trick perfectly, I should start having a look at those articles (no
    clues in the API section). Shouldn't that polymer-signals element be part
    of the core, just as core-ajax ?

    —
    Reply to this email directly or view it on GitHub
    #145 (comment).

  6. sjmiles commented on Aug 18, 2014

    @sjmiles
    Contributor

    Broadcast seems like a bad idea at this point. There are other patterns:

    1. child elements bubble an event to register interest in a signal
    2. core-signals
    3. child element registers listener on body, signal is bubbled up instead of waterfalled down (flavor of [2], as implemented currently)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions