Skip to content

Commit 2acfe40

Browse files
authored
Add comprehensive documentation for OpenObservation (#2)
1 parent 8ec3b7c commit 2acfe40

11 files changed

Lines changed: 1389 additions & 13 deletions

File tree

.spi.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- documentation_targets: [OpenObservation]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Kyle-Ye
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ dependencies: [
3434
]
3535
```
3636

37+
## Documentation
38+
39+
Comprehensive documentation is available on [Swift Package Index](https://swiftpackageindex.com/OpenSwiftUIProject/OpenObservation/main/documentation/openobservation).
40+
3741
## Usage
3842

3943
```swift
@@ -66,4 +70,6 @@ withObservationTracking {
6670
## License
6771

6872
- **OpenObservation code**: MIT License
69-
- **Code derived from Swift project**: Apache License v2.0 with Runtime Library Exception
73+
- **Code derived from Swift project**: Apache License v2.0 with Runtime Library Exception
74+
75+
See LICENSE file.

Sources/OpenObservation/Observable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// Conforming to this protocol signals to other APIs that the type supports
1616
/// observation. However, applying the `Observable` protocol by itself to a
1717
/// type doesn't add observation functionality to the type. Instead, always use
18-
/// the ``Observation/Observable()`` macro when adding observation
18+
/// the ``OpenObservation/Observable()`` macro when adding observation
1919
/// support to a type.
2020
public protocol Observable { }
2121

@@ -24,7 +24,7 @@ public protocol Observable { }
2424
/// Defines and implements conformance of the Observable protocol.
2525
///
2626
/// This macro adds observation support to a custom type and conforms the type
27-
/// to the ``Observation/Observable`` protocol. For example, the following code
27+
/// to the ``OpenObservation/Observable`` protocol. For example, the following code
2828
/// applies the `Observable` macro to the type `Car` making it observable:
2929
///
3030
/// @Observable

Sources/OpenObservation/ObservationRegistrar.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// Provides storage for tracking and access to data changes.
1313
///
1414
/// You don't need to create an instance of `ObservationRegistrar` when using
15-
/// the ``Observation/Observable()`` macro to indicate observability of a type.
15+
/// the ``OpenObservation/Observable()`` macro to indicate observability of a type.
1616
public struct ObservationRegistrar: Sendable {
1717
internal class ValueObservationStorage {
1818
func emit<Element>(_ element: Element) -> Bool { return false }
@@ -296,8 +296,8 @@ public struct ObservationRegistrar: Sendable {
296296
/// Creates an instance of the observation registrar.
297297
///
298298
/// You don't need to create an instance of
299-
/// ``Observation/ObservationRegistrar`` when using the
300-
/// ``Observation/Observable()`` macro to indicate observably
299+
/// ``OpenObservation/ObservationRegistrar`` when using the
300+
/// ``OpenObservation/Observable()`` macro to indicate observably
301301
/// of a type.
302302
public init() {
303303
}

0 commit comments

Comments
 (0)