Skip to content
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

contextual communication between components #31

Closed
2 of 3 tasks
AndyOGo opened this issue Dec 5, 2017 · 7 comments
Closed
2 of 3 tasks

contextual communication between components #31

AndyOGo opened this issue Dec 5, 2017 · 7 comments
Assignees

Comments

@AndyOGo
Copy link

AndyOGo commented Dec 5, 2017

After I quickly fixed #26 (publish/subscribe) I see the possible use case of a list of child components who need to communicate between each other within a specific context.

<axa-context>
  <axa-foo></axa-foo>
  <axa-bar></axa-bar>
</axa-context>

<axa-context>
  <axa-foo></axa-foo>
  <axa-bar></axa-bar>
</axa-context>

With a small hack this can be archived currently using incremental channels, like:

let n = 0;
publish(`channel-${n}/change`, ...)
subscribe(`channel-${n}/change`, ...)

...
++n;
publish(`channel-${n}/change`, ...)
subscribe(`channel-${n}/change`, ...)

Requirements

  • enable intercommunication between hierarchy-agnostic components
  • opt-in to select kind of context
  • pass contextual data down
@AndyOGo
Copy link
Author

AndyOGo commented Dec 5, 2017

A concrete use case is showing/hiding the mobile main navigation upon burger button click.

@AndyOGo
Copy link
Author

AndyOGo commented Dec 6, 2017

@LucaMele
Well, seems that the constructor of a parent Web Components is called after the connectedCallback of child components, which breaks context retrieval...

Possible that this is related to how Web Components are bootstrapped #27 or our DOMContentLoaded fix...

screen shot 2017-12-06 at 13 35 29

@LucaMele
Copy link
Contributor

LucaMele commented Dec 6, 2017

regarding ur last comment: Thank you, but as said in the #41 it follows the proposed standard and therefore no issue.

@LucaMele
Copy link
Contributor

LucaMele commented Dec 6, 2017

regarding ur last comment: Thank you, but as already said it follows the proposed standard and therefore no issue.

@LucaMele LucaMele closed this as completed Dec 6, 2017
@AndyOGo
Copy link
Author

AndyOGo commented Dec 6, 2017

Okay, I got your point.
Nevertheless we currently face this problem and this makes it a bug.
I'm fine if you want to call it feature, but it needs to be handled for the sake of this project.

@AndyOGo AndyOGo reopened this Dec 6, 2017
@LucaMele
Copy link
Contributor

LucaMele commented Dec 6, 2017

Agreed, as an enhancement and with the title as finding a valid solution to a problem and not complaining the specs. Lets sit together and find a solution

@LucaMele
Copy link
Contributor

closing as new plib version is live. If issue is with v2 still relevant, please re-open

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

No branches or pull requests

2 participants