Skip to content
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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

[PWN-9575] Feature/pwn 9575 #1559

wants to merge 7 commits into from

Conversation

TrGiLong
Copy link
Collaborator

@TrGiLong TrGiLong commented Aug 8, 2023

Link jira to issue

https://p2pvalidator.atlassian.net/browse/PWN-9575

Description of the changes

@github-actions github-actions bot changed the title Feature/pwn 9575 [PWN-9575] Feature/pwn 9575 Aug 8, 2023
Action: KeyAppStateMachine.Action,
Dispatcher: KeyAppStateMachine.Dispatcher<State, Action>
> {
public actor StateMachine<Dispatcher> where Dispatcher: KeyAppStateMachine.Dispatcher {
Copy link
Collaborator

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)
Copy link
Collaborator

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
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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) {}
Copy link
Collaborator

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] = []
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants