You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
405 B
21 lines
405 B
//
|
|
// Storable.swift
|
|
// LeStorage
|
|
//
|
|
// Created by Laurent Morvillier on 03/02/2024.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public protocol Storable : Codable, Identifiable where ID : StringProtocol {
|
|
static func resourceName() -> String
|
|
func deleteDependencies() throws
|
|
}
|
|
|
|
extension Storable {
|
|
|
|
public func findById<T : Storable>(_ id: String) -> T? {
|
|
return Store.main.findById(id)
|
|
}
|
|
|
|
}
|
|
|