From f19c69210309cbba088596f054114aa31a0fb041 Mon Sep 17 00:00:00 2001 From: Alexander Kauer Date: Thu, 6 Nov 2025 11:06:26 +0100 Subject: [PATCH 1/4] Update deleteStatus type in ActionViewModel Changed deleteStatus type from AsyncLoad to AsyncLoadNoContent. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f5aba8..93b5c4a 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,9 @@ import AsyncLoad @Observable class ActionViewModel { - var deleteStatus: AsyncLoad = .none // No type parameter needed + var deleteStatus: AsyncLoadNoContent = .none // No type parameter needed + // alterantive declaration + // var deleteStatus = AsyncLoad(.none) func deleteItem(id: String) async { deleteStatus = .loading From de75a1d9c1aa37392d57f67b69a661a27a5299b7 Mon Sep 17 00:00:00 2001 From: Alexander Kauer Date: Tue, 18 Nov 2025 10:57:52 +0100 Subject: [PATCH 2/4] Added uuid to no content to trigger change when it is reinitialized --- Sources/AsyncLoad/AsyncLoad/AsyncLoad+NoContent.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/AsyncLoad/AsyncLoad/AsyncLoad+NoContent.swift b/Sources/AsyncLoad/AsyncLoad/AsyncLoad+NoContent.swift index d857cef..db043a8 100644 --- a/Sources/AsyncLoad/AsyncLoad/AsyncLoad+NoContent.swift +++ b/Sources/AsyncLoad/AsyncLoad/AsyncLoad+NoContent.swift @@ -3,6 +3,8 @@ import Foundation public typealias AsyncLoadNoContent = AsyncLoad public struct NoContent: Equatable, Sendable { + public let uuid = UUID() + public init() { } } From fe7030fa0b898f737eb5ddd12d80a9f114426d5a Mon Sep 17 00:00:00 2001 From: Alexander Kauer Date: Tue, 18 Nov 2025 10:58:33 +0100 Subject: [PATCH 3/4] fixed typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93b5c4a..a95a7fb 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ import AsyncLoad @Observable class ActionViewModel { var deleteStatus: AsyncLoadNoContent = .none // No type parameter needed - // alterantive declaration + // alternative declaration // var deleteStatus = AsyncLoad(.none) func deleteItem(id: String) async { From d27c9bfe8d4e76a29c2856e8692aa267b0364763 Mon Sep 17 00:00:00 2001 From: Alexander Kauer Date: Tue, 18 Nov 2025 11:01:17 +0100 Subject: [PATCH 4/4] Fixed NoContent tests --- Tests/AsyncLoadTests/AsyncLoad+NoContentTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/AsyncLoadTests/AsyncLoad+NoContentTests.swift b/Tests/AsyncLoadTests/AsyncLoad+NoContentTests.swift index dbd3d3b..cfa0507 100644 --- a/Tests/AsyncLoadTests/AsyncLoad+NoContentTests.swift +++ b/Tests/AsyncLoadTests/AsyncLoad+NoContentTests.swift @@ -14,7 +14,6 @@ struct AsyncLoadNoContentTests { @Test<[AsyncLoadNoContentParameter]>("Should be equal", arguments: [ .init(.none, .none), .init(.loading, .loading), - .init(.loaded, .loaded), .init(.error(TestingError.some), .error(TestingError.some)), ]) func noContentEqual(_ parameter: AsyncLoadNoContentParameter) { @@ -26,6 +25,7 @@ struct AsyncLoadNoContentTests { .init(.none, .loading), .init(.loading, .loaded), .init(.loaded, .error(TestingError.some)), + .init(.loaded, .loaded), .init(.error(TestingError.some), .none), ]) func noContentNotEqual(_ parameter: AsyncLoadNoContentParameter) {