Skip to content

Commit 2ce84cc

Browse files
authored
Don't use @published for ViewStore state (#199)
* Don't use @published for ViewStore state * Update ci.yml * Update format.yml
1 parent 3038070 commit 2ce84cc

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
branches:
99
- '*'

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Format
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
jobs:
99
swift_format:

Sources/ComposableArchitecture/ViewStore.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ public final class ViewStore<State, Action>: ObservableObject {
6666
}
6767

6868
/// The current state.
69-
@Published public internal(set) var state: State
69+
public private(set) var state: State {
70+
willSet {
71+
self.objectWillChange.send()
72+
}
73+
}
7074

7175
let _send: (Action) -> Void
7276

0 commit comments

Comments
 (0)