Skip to content

Add a side_effect option to data properties. #237

@julianstirling

Description

@julianstirling

Is your feature request related to a problem? Please describe.
Data properties are a lot shorter and cleaner to write than functional properties when a property is simple. However, if I need something to happen when the property is set (forwarding it to hardware, re-generating cached data, etc) then a functional property is needed.

Describe the solution you'd like

A side_effect argument that can accept a callable.

frame_rate: float = lt.property(default=25, side_effect=self.update_camera_properties)

I am not sure however, if it is possible to use self here? As it is within a class but not within a classes function where self is defined?

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