We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b7f913 commit fb865eeCopy full SHA for fb865ee
Yosemite/Yosemite/Stores/AccountStore.swift
@@ -25,6 +25,8 @@ public class AccountStore: Store {
25
switch action {
26
case .synchronizeAccount(let onCompletion):
27
synchronizeAccount(onCompletion: onCompletion)
28
+ case .loadAccount(let userID, let onCompletion):
29
+ loadAccount(userID: userID, onCompletion: onCompletion)
30
}
31
32
@@ -49,6 +51,13 @@ extension AccountStore {
49
51
onCompletion(account, nil)
50
52
53
54
+
55
+ /// Loads the Account associated with the specified userID (if any!).
56
+ ///
57
+ func loadAccount(userID: Int, onCompletion: @escaping (Account?) -> Void) {
58
+ let account = loadStoredAccount(userId: userID)?.toReadOnly()
59
+ onCompletion(account)
60
+ }
61
62
63
0 commit comments