Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Proposal: Mixin Assignments #8

Open
grebaldi opened this issue Jul 11, 2015 · 1 comment
Open

Proposal: Mixin Assignments #8

grebaldi opened this issue Jul 11, 2015 · 1 comment

Comments

@grebaldi
Copy link
Member

I thought about this for quite a while now and I think it does make sense. Think of the following scenario:

I have a form, like:

<form data-app="MyFormComponent"></form>

MyFormComponent might combine quite a lot of functionality, like some visual effects, validation and printing of validation messages.

Since at least two of these functionalities do not depend on each other, you would have better semantics and decoupling by writing something like this:

<form data-app="FancyEyeCandyComponent ValidatorComponent"></form>

If you really have disjunct functionality (like eye-candy <-> validation) it would just be great to have the option to apply all at once, whithout the need to hard-wire them into each other on JS side.

One could go pretty mad about this one and write something like this:

<form data-app="FancyEyeCandyComponent ValidatorComponent SendStuffToServerComponent">
</form>

Which would be easily interchangeable to:

<form data-app="FancyEyeCandyComponent ValidatorComponent JustLogStuffComponent">
</form>

If these apply in order, you would get interchangeable and functionality-disjunct components, with the positive effect of describing behavior on the fly.

What do you think?

@Inkdpixels
Copy link
Contributor

Yeah I also had this in mind a while ago, and it does indeed make a lot of sense. So if you have a some spare time, go for a PR - Or I will implement this as soon I am Done with the ES6 rewrite as seen in #6

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

No branches or pull requests

2 participants