StatefulEvent

public class StatefulEvent<T> : Event<T>

Property wrapper that can be used to define an event publisher/source pair using a single property which can also hold state and notify sources when its state has changed.

When used as a property wrapper, events can be registered to with someEvent.addListener(), and published with _someEvent.publishEvent(<eventValue>) or _someEvent(<eventValue>).

Warning: Not thread-safe.

  • Initializes this stateful event with an initial state.

    Declaration

    Swift

    public init(wrappedValue: T)
  • Declaration

    Swift

    public override func publishEvent(_ event: T)
  • Declaration

    Swift

    public override func callAsFunction(_ event: T)