Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Fix signal for asynchronous updates
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed Sep 19, 2024
1 parent bb1d946 commit 0a902be
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/Model/Data Flow/Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ public struct Signal: Sendable {
public let id: UUID = .init()

/// Whether the action has caused an update.
public var update: Bool { boolean }
public var update: Bool {
let copy = boolean
if copy {
boolean = false
}
return copy
}

/// Initialize a signal.
public init() { }

/// Activate a signal.
public func signal() {
boolean = true
boolean = false
}

}

0 comments on commit 0a902be

Please sign in to comment.