Save automatically, improve mocks

This commit is contained in:
Christoph Hagen
2025-02-05 12:24:33 +01:00
parent d41c54d174
commit 5abe6e1a9f
55 changed files with 701 additions and 381 deletions

View File

@ -1,6 +1,7 @@
import Foundation
import Combine
class Item: ObservableObject, Identifiable {
class Item: ObservableContentItem, Identifiable {
unowned let content: Content
@ -11,17 +12,25 @@ class Item: ObservableObject, Identifiable {
@Published
var id: String
var cancellables = Set<AnyCancellable>()
init(content: Content, id: String) {
self.content = content
self.id = id
observeChanges()
}
// MARK: Change observation
func didChange() {
DispatchQueue.main.async {
self.changeToggle.toggle()
}
}
// MARK: Paths
func makeCleanAbsolutePath(_ path: String) -> String {
"/" + makeCleanRelativePath(path)
}

View File

@ -9,3 +9,7 @@ struct ItemId {
extension ItemId: Codable {
}
extension ItemId: Equatable {
}