david-swift 36e61255f8 Add support for toasts
Add the new concept of signals
2023-11-30 21:14:45 +01:00

27 lines
510 B
Swift

//
// Signal.swift
// Adwaita
//
// Created by david-swift on 30.11.23.
//
/// A type that signalizes an action.
public struct Signal {
/// An action is signalized by toggling a boolean to `true` and back to `false`.
@State var boolean = false
/// Whether the action has caused an update.
public var update: Bool { boolean }
/// Initialize a signal.
public init() { }
/// Activate a signal.
public func signal() {
boolean = true
boolean = false
}
}