Skip to content

Commit 48adade

Browse files
authored
Merge branch 'VictorKachalov:master' into master
2 parents 4fd3987 + 6e76b90 commit 48adade

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Example/SwiftBloc/BlocContentView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ struct BlocContentView: View {
1313
var body: some View {
1414
NavigationView {
1515
BlocView(builder: { (bloc) in
16+
let isPresented = Binding.constant(bloc.state.count < -6)
1617
CounterView()
17-
.alert(isPresented: bloc.shouldShowAlertBinding) {
18+
.alert(isPresented: isPresented) {
1819
Alert(
1920
title: Text("Hi"),
2021
message: Text("Message"),

Example/SwiftBloc/CounterBloc.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ struct CounterState: Equatable {
2323
}
2424

2525
class CounterBloc: Bloc<CounterEvent, CounterState> {
26-
var shouldShowAlertBinding: Binding<Bool> {
27-
Binding.constant(state.count < -6)
28-
}
29-
3026
init() {
3127
super.init(initialState: CounterState(count: 0))
3228
}

0 commit comments

Comments
 (0)