Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Updated self as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sladan-hedvig committed Mar 5, 2024
1 parent 14f80fb commit 32808c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Presentation/PresentableStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,15 @@ open class StateStore<State: StateProtocol, Action: ActionProtocol>: Store {
}, action)
} catch _ {
DispatchQueue.main.async {[weak self] in guard let self = self else { return }
let previousThread = Thread.current
if let effectActionSignal: FiniteSignal<Action> = self.effects({
self.stateSignal.value
}, action) {
let bag = DisposeBag()

let effectSignal = EffectSignal(action, effectActionSignal)

bag += effectActionSignal.atValue { action in
self.send(action)
bag += effectActionSignal.atValue {[weak self] action in
self?.send(action)
}.onEnd { [weak self] in
self?.cancelEffect(effectSignal.id)
}
Expand All @@ -142,7 +141,6 @@ open class StateStore<State: StateProtocol, Action: ActionProtocol>: Store {
}
}
}

}

public required init() {
Expand Down

0 comments on commit 32808c4

Please sign in to comment.