|
@@ -26,6 +26,7 @@ public extension MeetupId { |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
static func shouldFinishLoading(_ c: MeetupIdContext) -> Bool? { |
|
|
static func shouldFinishLoading(_ c: MeetupIdContext) -> Bool? { |
|
|
guard |
|
|
guard |
|
|
c.isLoading.isRecent, |
|
|
c.isLoading.isRecent, |
|
@@ -35,6 +36,7 @@ public extension MeetupId { |
|
|
} |
|
|
} |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
static func shouldResetLoading(_ c: MeetupIdContext) -> Bool? { |
|
|
static func shouldResetLoading(_ c: MeetupIdContext) -> Bool? { |
|
|
if |
|
|
if |
|
@@ -54,25 +56,47 @@ public extension MeetupId { |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
static func shouldResetText(_ c: MeetupIdContext) -> String? { |
|
|
static func shouldResetText(_ c: MeetupIdContext) -> String? { |
|
|
guard c.textUI.isRecent else { return nil } |
|
|
guard c.textUI.isRecent else { return nil } |
|
|
return formatId(c.textUI.value) |
|
|
return formatId(c.textUI.value) |
|
|
} |
|
|
} |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
// MARK: - Many |
|
|
// MARK: - Many |
|
|
|
|
|
static func shouldManyFinishLoading(_ c: MeetupIdContext) -> MPAK.Many<Bool>? { |
|
|
|
|
|
guard !c.isLoading.keys.isEmpty else { return nil } |
|
|
|
|
|
var keys = Set<String>() |
|
|
|
|
|
var d = [String: Bool]() |
|
|
|
|
|
for id in c.isLoading.keys { |
|
|
|
|
|
if |
|
|
|
|
|
let isLoading = c.isLoading.dict[id], |
|
|
|
|
|
isLoading |
|
|
|
|
|
{ |
|
|
|
|
|
keys.insert(id) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return MPAK.Many(keys, d) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static func shouldManyResetText(_ c: MeetupIdContext) -> MPAK.Many<String>? { |
|
|
static func shouldManyResetText(_ c: MeetupIdContext) -> MPAK.Many<String>? { |
|
|
/**/print("ИГР MeetupIS.shouldMRT-1") |
|
|
|
|
|
|
|
|
guard !c.textUI.keys.isEmpty else { return nil } |
|
|
|
|
|
var d = [String: String]() |
|
|
|
|
|
for id in c.textUI.keys { |
|
|
|
|
|
let text = c.textUI.dict[id] ?? "" |
|
|
|
|
|
d[id] = formatId(text) |
|
|
|
|
|
} |
|
|
|
|
|
return MPAK.Many(c.textUI.keys, d) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static func shouldManyTestResetText(_ c: MeetupIdContext) -> MPAK.Many<String>? { |
|
|
guard !c.testTextUI.keys.isEmpty else { return nil } |
|
|
guard !c.testTextUI.keys.isEmpty else { return nil } |
|
|
/**/print("ИГР MeetupIS.shouldMRT-2") |
|
|
|
|
|
var d = [String: String]() |
|
|
var d = [String: String]() |
|
|
for id in c.testTextUI.keys { |
|
|
for id in c.testTextUI.keys { |
|
|
let text = c.testTextUI.dict[id] ?? "" |
|
|
let text = c.testTextUI.dict[id] ?? "" |
|
|
d[id] = formatId(text) |
|
|
d[id] = formatId(text) |
|
|
} |
|
|
} |
|
|
let r = MPAK.Many(c.testTextUI.keys, d) |
|
|
|
|
|
/**/print("ИГР MeetupIS.shouldMRT-3 r: '\(r)'") |
|
|
|
|
|
return r |
|
|
|
|
|
|
|
|
return MPAK.Many(c.testTextUI.keys, d) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |