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

Polymer 2.0 mixin #15

Open
AndreasGalster opened this issue Mar 16, 2017 · 3 comments
Open

Polymer 2.0 mixin #15

AndreasGalster opened this issue Mar 16, 2017 · 3 comments

Comments

@AndreasGalster
Copy link

AndreasGalster commented Mar 16, 2017

I'm looking at PolymerApollo right now, trying to convert your behavior to 2.0 syntax. Some things to discuss are:

  • Where to put beforeRegister stuff? This has been removed with 2.x, I think this might belong into the constructor now (2.0 is class based like standard webcomponents)
  • How do we create the PolymerApollo behavior?

I was thinking doing it like so:

export const PolymerApollo = (superclass, options) => class extends superclass {

And then in the component do this maybe?

class AppShell extends PolymerApolloBehavior(Polymer.Element, apolloClient) {

Please let me know what you think, I'm just learning classes now, so I'm not sure if that makes sense.

Almost got something working, just gotta fix some dependencies in a demo, then I'll push a sample repo with what I have so far.

@fwielstra
Copy link

I'm trying to get this to work in Polymer 2 too, but no luck so far;

using the wrapping syntax (class MyElement extends PolymerApolloBehavior(Polymer.Element) {}) gives the error Uncaught TypeError: PolymerApolloBehavior is not a function

Using Polymer.mixinBehaviors([PolymerApolloBehavior, Polymer.Element]) gives the error Uncaught TypeError: Cannot read property '__mixinSet' of undefined.

@aruntk
Copy link
Owner

aruntk commented Jul 6, 2017

@fwielstra
Copy link

I am an idiot and used a wrong version of a polymer component again. Sorry <3

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

No branches or pull requests

3 participants