Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Akamu
Game Client iOS
Commits
9b491524
Commit
9b491524
authored
Jul 19, 2020
by
Maurice Kraus
Browse files
feat(viewmodel): this adds a password change input and output
parent
1c84f8e1
Pipeline
#1897
passed with stages
in 14 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
AkamuCore/Sources/AkamuCore/UILayer/ViewModels/Profile/ProfileViewModel.swift
View file @
9b491524
...
...
@@ -18,11 +18,13 @@ public struct ProfileViewModel: ProfileViewModelType {
private
let
logoutSubject
:
PublishSubject
<
Void
>
private
let
subjectSelectionSubject
:
PublishRelay
<
Void
>
private
let
titleSelectionSubject
:
PublishRelay
<
Void
>
private
let
passwordChangeSelectionSubject
:
PublishRelay
<
Void
>
private
let
userSessionRepository
:
UserSessionRepository
public
let
didLogout
:
Observable
<
Void
>
public
let
didSelectPoolSelection
:
Observable
<
Void
>
public
let
didSelectTitleSelection
:
Observable
<
Void
>
public
let
didSelectPasswordChange
:
Observable
<
Void
>
public
let
username
:
Driver
<
String
>
public
let
level
:
Driver
<
String
>
public
let
exp
:
Driver
<
String
>
...
...
@@ -58,6 +60,9 @@ public struct ProfileViewModel: ProfileViewModelType {
titleSelectionSubject
=
PublishRelay
()
didSelectTitleSelection
=
titleSelectionSubject
.
asObservable
()
passwordChangeSelectionSubject
=
PublishRelay
()
didSelectPasswordChange
=
passwordChangeSelectionSubject
.
asObservable
()
poolsString
=
poolRepository
.
getPools
()
.
asDriver
(
onErrorJustReturn
:
[])
.
map
{
$0
.
filter
{
$0
.
selected
}
.
reduce
(
""
)
{
(
resultString
,
pool
)
->
String
in
...
...
@@ -97,4 +102,11 @@ public struct ProfileViewModel: ProfileViewModelType {
return
.
empty
()
}
}(
self
.
titleSelectionSubject
)
public
lazy
var
onPasswordChangeSelection
:
CocoaAction
=
{
subject
in
Action
{
subject
.
accept
(())
return
.
empty
()
}
}(
self
.
passwordChangeSelectionSubject
)
}
AkamuCore/Sources/AkamuCore/UILayer/ViewModels/Profile/ProfileViewModelType.swift
View file @
9b491524
...
...
@@ -22,10 +22,12 @@ public protocol ProfileViewModelType {
var
onLogout
:
CocoaAction
{
mutating
get
}
var
onSubjectSelection
:
CocoaAction
{
mutating
get
}
var
onTitleSelection
:
CocoaAction
{
mutating
get
}
var
onPasswordChangeSelection
:
CocoaAction
{
mutating
get
}
// Output
var
didSelectPoolSelection
:
Observable
<
Void
>
{
get
}
var
didSelectTitleSelection
:
Observable
<
Void
>
{
get
}
var
didSelectPasswordChange
:
Observable
<
Void
>
{
get
}
var
didLogout
:
Observable
<
Void
>
{
get
}
var
username
:
Driver
<
String
>
{
get
}
var
level
:
Driver
<
String
>
{
get
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment