-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from rokon-uddin/repository_segregation
chore: refactor repository to separate interfaces that the repository…
- Loading branch information
Showing
9 changed files
with
105 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ersistentPlatform/Sources/PersistentPlatform/Repository/PreparePersistentRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// PreparePersistentRepository.swift | ||
// PersistentPlatform | ||
// | ||
// Created by {{ cookiecutter.creator }} on {% now 'utc', '%d/%m/%Y' %}. | ||
// Copyright © {% now 'utc', '%Y' %} {{cookiecutter.company_name}}. All rights reserved. | ||
// | ||
|
||
import Domain | ||
import Foundation | ||
|
||
public struct PreparePersistentRepository: Domain.PrepareRepository { | ||
|
||
private let persistenceController: PersistenceController | ||
|
||
init(persistenceController: PersistenceController) { | ||
self.persistenceController = persistenceController | ||
} | ||
|
||
public func prepare() async { | ||
do { | ||
try await persistenceController.prepare() | ||
} catch { | ||
fatalError(error.localizedDescription) | ||
} | ||
} | ||
} | ||
|
||
extension PreparePersistentRepository { | ||
public static var live = PreparePersistentRepository( | ||
persistenceController: PersistenceController.shared) | ||
} | ||
|