Skip to content

Commit cfe9c5b

Browse files
authored
Update README (#32)
1 parent 0898405 commit cfe9c5b

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,29 @@
4343

4444
|Reactive Data Binding|Effective Data Caching|Compile Safe<br>Dependency Injection|
4545
|:------------------------|:----------------|:--------------------------------|
46-
|Piece of app data that can be accessed from anywhere propagates changes reactively.|Recompute atom data and views only when truly need, otherwise it caches data until no longer used.|Successful compilation guarantees that dependency injection is ready.|
46+
|Pieces of app data that can be accessed from anywhere propagate changes reactively.|Recompute atom data and views only when truly needed, otherwise, it caches data until no longer used.|Successful compilation guarantees that dependency injection is ready.|
4747

4848
</p>
4949

5050
SwiftUI Atom Properties offers practical capabilities to manage the complexity of modern apps. It effectively integrates the solution for both data-binding and dependency injection while allowing us to rapidly building an application.
5151

5252
### Motivation
5353

54-
SwiftUI offers a simple and understandable data-binding solution with built-in property wrappers, but is a little uneasiness for building middle to large scale production apps. As a typical example, view data can only be shared by pushing it up to a common ancestor.
55-
Software development is not all set in advance; it evolves over time to meet business and customer needs. Therefore, you may need to radically redesign it so that local data used only in one part of the view-tree can be shared elsewhere, as the app grows.
56-
EnvironmentObject was hoped to be a solution to the problem, but it ended up with let us to create a huge state-holder object - [Big Ball of Mud](https://en.wikipedia.org/wiki/Big_ball_of_mud) being provided from the root of an app, so it could not be an ideal.
57-
Ultimately, pure SwiftUI needs state-drilling from the root to descendants in anyway, which not only makes code-splitting difficult, but also causes gradual performance degradation due to the huge view-tree computation as the app grow up.
54+
SwiftUI offers a simple and understandable data-binding solution with built-in property wrappers but is a little uneasy for building middle to large-scale production apps. As a typical example, view data can only be shared by pushing it up to a common ancestor.
55+
EnvironmentObject was hoped to be a solution to the problem, but it ended up with let us create a huge state-holder object being provided from the root of an app, so pure SwiftUI needs state-drilling from the root to descendants in any way, which not only makes code-splitting difficult but also causes gradual performance degradation due to the huge view-tree computation as the app grow up.
5856

59-
This library solves these problems by defining application data as distributed pieces called atom, allowing data to be shared throughout the app as the source of truth. That said, atom itself doesn't have internal state, but rather retrieves the associated state from the context in which they are used, and ensures that the app is testable.
60-
Furthermore, it manages a directed graph of atoms and propagates data changes transitively from upstream to downstream, such that it updates only the views truly need update while preventing expensive data recomputation, resulting in effortlessly high performance and efficient memory use.
57+
This library solves these problems by defining application data as distributed pieces called atoms, allowing data to be shared throughout the app as the source of truth. That said, an atom itself doesn't have an internal state, but rather retrieves the associated state from the context in which they are used, and ensures that the app is testable.
58+
It manages a directed graph of atoms and propagates data changes transitively from upstream to downstream, such that it updates only the views that truly need update while preventing expensive data recomputation, resulting in effortlessly high performance and efficient memory use.
6159

6260
<img src="assets/diagram.png" width=700>
6361

6462
This approach guarantees the following principles:
6563

66-
- Reactively reflects data changes into views.
64+
- Reactively reflects data changes.
6765
- Boilerplate-free interface where shared data has the same simple interface as SwiftUI built-ins.
68-
- Compatible with any other libraries (e.g. [TCA](https://github.com/pointfreeco/swift-composable-architecture)) of your choice if needed.
66+
- Compatible with any other libraries like [TCA](https://github.com/pointfreeco/swift-composable-architecture).
6967
- Accelerates code-splitting by distributed & incremental state definition.
70-
- Ensures testable code over time with capabilities of dependency injection.
68+
- Ensures testable with capabilities of dependency injection.
7169
- Provides simplified interfaces for asynchronous process.
7270
- Swift Concurrency based thread-safety.
7371

@@ -196,7 +194,7 @@ And then, include "Atoms" as a dependency for your target:
196194

197195
### Basic Tutorial
198196

199-
In this tutorial, we will create a simple todo app as an example. This app will support:
197+
In this tutorial, we are going to create a simple todo app as an example. This app will support:
200198

201199
- Create todo items
202200
- Edit todo items
@@ -344,7 +342,7 @@ struct TodoItem: View {
344342
}
345343
```
346344

347-
Use `@Watch` to obtain the value of `FilteredTodosAtom` read-only. Updates to any of the dependent atoms are propagated to this view, and it re-render the todo list.
345+
Use `@Watch` to obtain the value of `FilteredTodosAtom` read-only. It updates to any of the dependent atoms are propagated to this view, and it re-render the todo list.
348346
Finally, assemble the views we've created so far and complete.
349347

350348
```swift

assets/assets.key

-3 KB
Binary file not shown.

assets/diagram.png

-12.4 KB
Loading

0 commit comments

Comments
 (0)