Deviopath › Swift

State Reducer

Hard · SwiftUI

A tiny Redux/TCA-style reducer. State is a count. Actions: "inc", "dec", "add:N". Write reduce(_:_:) that returns the new count. Count cannot go below 0.

Next: Stable IDs