-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PWN-9575] Feature/pwn 9575 #1559
base: develop
Are you sure you want to change the base?
Conversation
Action: KeyAppStateMachine.Action, | ||
Dispatcher: KeyAppStateMachine.Dispatcher<State, Action> | ||
> { | ||
public actor StateMachine<Dispatcher> where Dispatcher: KeyAppStateMachine.Dispatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MARK: - Nested type
@@ -8,6 +8,8 @@ public protocol Dispatcher<State, Action> { | |||
associatedtype State: KeyAppStateMachine.State | |||
associatedtype Action: KeyAppStateMachine.Action | |||
|
|||
func onEnter(currentState: State) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove onEnter, as actionWillBeginDispatching already handled this case
// MARK: - Dependencies | ||
|
||
/// Dispatcher that controls dispatching actions | ||
private let dispatcher: Dispatcher | ||
let dispatcher: Dispatcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverse scope since these properties are used nowhere else
|
||
stateSubject.sink { state in | ||
dispatcher.onEnter(currentState: state) | ||
}.store(in: &subscriptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove onEnter
|
||
case calculating | ||
|
||
case receiveError(input: NSendInput, output: NSendOutput?, error: NSendError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calculate, calculating, recieveError should be removed alongside with onEnter
@@ -51,6 +51,8 @@ class RecruitmentDispatcher: Dispatcher { | |||
} | |||
} | |||
|
|||
func onEnter(currentState _: RecruitmentState) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed
private var currentTask: Task<Void, Never>? | ||
var currentTask: Task<Void, Never>? | ||
|
||
var subscriptions: [AnyCancellable] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subscriptions need to be removed too when onEnter is no longer needed
Link jira to issue
https://p2pvalidator.atlassian.net/browse/PWN-9575
Description of the changes