Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

Whether you're working on any platform or within any framework, **OneWay** can seamlessly integrate. With zero third-party dependencies, **OneWay** can be used in its purest form. This library isn't limited to use only for the presentation layer. It's also useful for streamlining intricate business logic. You'll find it beneficial whenever you seek to implement logic in a unidirectional manner.

> [!NOTE]
> OneWay is a good solution for preparing Swift 6.

- [Data Flow](#data-flow)
- [Usage](#usage)
- [Documentation](#documentation)
Expand Down Expand Up @@ -71,11 +68,9 @@ struct CountingReducer: Reducer {
case .increment:
state.number += 1
return .none

case .decrement:
state.number -= 1
return .none

case .twice:
return .concat(
.just(.setIsLoading(true)),
Expand All @@ -85,7 +80,6 @@ struct CountingReducer: Reducer {
),
.just(.setIsLoading(false))
)

case .setIsLoading(let isLoading):
state.isLoading = isLoading
return .none
Expand Down Expand Up @@ -154,7 +148,7 @@ for await number in store.states.number {
// Prints "10", "20"
```

If you want to continue receiving the value even when the same value is assigned to the `State`, you can use `@Sensitive`. For explanations of other useful property wrappers(e.g. [@Heap](https://swiftpackageindex.com/devyeom/oneway/main/documentation/oneway/heap), [@Insensitive](https://swiftpackageindex.com/devyeom/oneway/main/documentation/oneway/insensitive)), refer to [here](https://swiftpackageindex.com/devyeom/oneway/main/documentation/oneway/sensitive).
If you want to continue receiving the value even when the same value is assigned to the `State`, you can use `@Sensitive`. For explanations of other useful property wrappers(e.g. [@CopyOnWrite](https://swiftpackageindex.com/devyeom/oneway/main/documentation/oneway/copyonwrite), [@Insensitive](https://swiftpackageindex.com/devyeom/oneway/main/documentation/oneway/insensitive)), refer to [here](https://swiftpackageindex.com/devyeom/oneway/main/documentation/oneway/sensitive).

```swift
struct State: Sendable, Equatable {
Expand Down
5 changes: 1 addition & 4 deletions Sources/OneWay/OneWay.docc/OneWay.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ struct CountingReducer: Reducer {
case .increment:
state.number += 1
return .none

case .decrement:
state.number -= 1
return .none

case .twice:
return .concat(
.just(.setIsLoading(true)),
Expand All @@ -41,7 +39,6 @@ struct CountingReducer: Reducer {
),
.just(.setIsLoading(false))
)

case .setIsLoading(let isLoading):
state.isLoading = isLoading
return .none
Expand Down Expand Up @@ -80,7 +77,7 @@ OneWay is released under the MIT license. See LICENSE for details.

### PropertyWrappers

- ``Heap``
- ``CopyOnWrite``
- ``Insensitive``
- ``Sensitive``

Expand Down