mobx-react-form icon indicating copy to clipboard operation
mobx-react-form copied to clipboard

Can we use `decorators` instead of `extends`?

Open sanketsahu opened this issue 9 years ago • 3 comments

I always recommend Composition over Inheritance.

Is there an option to use decorators instead of extends? Something like

@validatedForm
class MyForm {
    // ...
}

sanketsahu avatar Dec 16 '16 14:12 sanketsahu

Thank you for the suggestion, should be very cool to use decorators.

Recently I was looking for a solution to inject plugins before the form instance is created, using decorator seems definitely the way to go.

I have to think about of new apis design for the next major version, other enhancements are already scheduled!

foxhound87 avatar Dec 16 '16 15:12 foxhound87

@foxhound87 That's awesome! Thanks!

sanketsahu avatar Dec 19 '16 11:12 sanketsahu

I reopen this issue. I will close it when the new apis will be released.

foxhound87 avatar Dec 19 '16 14:12 foxhound87

MobX removed the use of decorators in newer versions, so I’m closing this issue.

foxhound87 avatar Apr 02 '23 22:04 foxhound87