skatejs/kickflip

The kickflip() custom element name should be optional.

treshugart opened this issue · 4 comments

If it is optional, kickflip() should return a function that accepts a name which will return a constructor.

This should still be supported:

const MyElement = kickflip('my-element', {
  render () {}
});

However we should support this:

const defineMyElement = kickflip({
  render () {}
});

const MyElement = defineMyElement('alternate-name');

Looks good. Will this mean we can create 2 elements using the same base, but override/extend one of them without affecting the other?

@seancurtis

Looks good. Will this mean we can create 2 elements using the same base, but override/extend one of them without affecting the other?

Yep. Basically, it becomes a factory to create a specific type of element.

This may actually be better going into Skate?

Closing as this should be implemented in Skate proper.