Skip to content

Commit

Permalink
async/await meow save helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Joannis committed Sep 14, 2021
1 parent cfd1945 commit 8bae3aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Meow/AsyncAwait.swift
Expand Up @@ -79,6 +79,14 @@ extension MeowCollection.Async where M: ReadableModel {
}
}

@available(macOS 12, iOS 15, *)
extension MutableModel {
@discardableResult
public func save(in database: MeowDatabase.Async) async throws -> MeowOperationResult {
try await self.save(in: database.nio).get()
}
}

@available(macOS 12, iOS 15, *)
extension MeowCollection.Async where M: MutableModel {
@discardableResult
Expand Down

0 comments on commit 8bae3aa

Please sign in to comment.