Skip to content

Add observers for props #12

@janhohenheim

Description

@janhohenheim

Something like

props.observe("alertness", on_set_alertness);

fn on_set_alertness(change: On<MutateProp>) {
  ...
}

#[derive(EntityEvent)]
struct MutateProp {
  /// Entity holding the [`Props`]
  #[event_target]
  entity: Entity,
  key: Ustr,
  old_value: Value,
  new_value: Value,
}

whether props.get("alertness") should trigger this when such a call initializes the value or reinitializes it to another data type I do not know. Maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions