Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

Enable ValidatingStore to trigger the validation from outsideΒ #948

@Lysander

Description

@Lysander

Currently the ValidatingStore does not offer any possibility to trigger the validation from the outside. The latter is quite important for situiations, where you need to make sure, all data is valid, but the user might not have yet changed anything.

The current solution might look like this:

class TriggerValidatingStore(data: String, validation: Validation<String, Unit, ComponentValidationMessage>, job: Job) :
    ValidatingStore<String, Unit, ComponentValidationMessage>(data, validation, Unit, job) {

    // this handler makes the validation available - not sure whether the `List<ComponentValidationMessage>`  should get emitted!
    val validate = handle { state ->
        validate(state)
        state
    }
}

Imho this is base functionality and should be integrated into the core type!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions