x-tag / core

The Heart of X-Tag
http://x-tag.github.io/
Other
1.25k stars 151 forks source link

How to define a component, but not name it, and let end user name it? #176

Open trusktr opened 6 years ago

trusktr commented 6 years ago

For example, with vanilla Web Components, I can ship this:

class FooBar extends HTMLElement {...}

then tell end users to use it like this:

customElements.define('foo-bar', FooBar) // but they can use any name they want
// ... use the element ...

How would I do this with X-Tags?

csuwildcat commented 6 years ago

This is coming in v2 - there is a create and register call where you can separate the two. Create can output just a computed class, and they you can register it with whatever name you choose.