-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
We can configure children component with the components config property:
import { Base } from '@studiometa/js-toolkit';
import { Bar } from './Bar.js';
class Foo extends Base {
static config = {
name: 'Foo',
components: {
Bar,
},
}
}It might be interesting to be able to configure siblings: components that would be mounted on the same element. This would allow for more composable features, as this would help get around the limitations of class inheritance (extending only one class, method or property names conflicts, etc.).
For example, a component which would need Transition capabilities could declare the Transition component as a sibling instead of extending from it.
Before
class Foo extends Transition {
static config = {
name: 'Foo',
};
onClick() {
this.enter();
}
}After
class Foo extends Base {
static config = {
name: 'Foo',
use: { // or `with`?
Transition,
}
};
onClick() {
this.$siblings.Transition.enter();
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels