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

Listener types #2

@hendrikebbers

Description

@hendrikebbers

Some ideas based on the API of Swift (https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Properties.html#//apple_ref/doc/uid/TP40014097-CH14-ID254). Here they provide a willSet(...) and didSet(...) while in the willSet(...) you can access newValue, in didSet(...) it is simply called value. Maybe we should think about something like a willSet(...) listener that can be used for validation etc. Based on some discussions I would currently prefer:

  • 1 listener type that will be called before the change. This listener will be called always (even if new value is equals old value). This listeners needs to have access to the old and new values. Maybe this can return a boolean value to interrupt the change based on validation etc.
  • 1 listener type that will be called after the change. This listener will only be called if the value really changed (old != new). Here you can access the value and the old value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions