Skip to content

The way to extends a Trait. #594

@tanbowensg

Description

@tanbowensg

What problem does this feature solve?
Sometimes traits need to be extended. For example, Validation Trait presets some rules, but the business logic always requires custom validation rules. Validation Trait needs to receive and register custom rules.

What does the proposed API look like?
Since the trait is a factory function, so one of the ways may be injecting dependencies in the trait's constructor function. And trait's dependencies can be passed in initSunmao(not the dependencies filed, but a new field).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestruntimeabout meta-ui runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions