Skip to content

Commit

Permalink
Make the state of Store be private setter (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobabear authored Jan 7, 2024
1 parent 63b7645 commit 35cbeb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/OneWay/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ where R.Action: Sendable, R.State: Sendable & Equatable {
public let initialState: State

/// The current state of a store.
public var state: State {
public private(set) var state: State {
didSet {
if oldValue != state {
continuation.yield(state)
Expand Down
2 changes: 1 addition & 1 deletion Sources/OneWay/ViewStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ where R.Action: Sendable, R.State: Sendable & Equatable {
public let initialState: State

/// The current state of a store.
public var state: State {
public private(set) var state: State {
didSet {
continuation.yield(state)
states.send(state)
Expand Down

0 comments on commit 35cbeb4

Please sign in to comment.