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
4 changes: 4 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [OpenObservation]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Kyle-Ye

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ dependencies: [
]
```

## Documentation

Comprehensive documentation is available on [Swift Package Index](https://swiftpackageindex.com/OpenSwiftUIProject/OpenObservation/main/documentation/openobservation).

## Usage

```swift
Expand Down Expand Up @@ -66,4 +70,6 @@ withObservationTracking {
## License

- **OpenObservation code**: MIT License
- **Code derived from Swift project**: Apache License v2.0 with Runtime Library Exception
- **Code derived from Swift project**: Apache License v2.0 with Runtime Library Exception

See LICENSE file.
4 changes: 2 additions & 2 deletions Sources/OpenObservation/Observable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// Conforming to this protocol signals to other APIs that the type supports
/// observation. However, applying the `Observable` protocol by itself to a
/// type doesn't add observation functionality to the type. Instead, always use
/// the ``Observation/Observable()`` macro when adding observation
/// the ``OpenObservation/Observable()`` macro when adding observation
/// support to a type.
public protocol Observable { }

Expand All @@ -24,7 +24,7 @@ public protocol Observable { }
/// Defines and implements conformance of the Observable protocol.
///
/// This macro adds observation support to a custom type and conforms the type
/// to the ``Observation/Observable`` protocol. For example, the following code
/// to the ``OpenObservation/Observable`` protocol. For example, the following code
/// applies the `Observable` macro to the type `Car` making it observable:
///
/// @Observable
Expand Down
6 changes: 3 additions & 3 deletions Sources/OpenObservation/ObservationRegistrar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/// Provides storage for tracking and access to data changes.
///
/// You don't need to create an instance of `ObservationRegistrar` when using
/// the ``Observation/Observable()`` macro to indicate observability of a type.
/// the ``OpenObservation/Observable()`` macro to indicate observability of a type.
public struct ObservationRegistrar: Sendable {
internal class ValueObservationStorage {
func emit<Element>(_ element: Element) -> Bool { return false }
Expand Down Expand Up @@ -296,8 +296,8 @@ public struct ObservationRegistrar: Sendable {
/// Creates an instance of the observation registrar.
///
/// You don't need to create an instance of
/// ``Observation/ObservationRegistrar`` when using the
/// ``Observation/Observable()`` macro to indicate observably
/// ``OpenObservation/ObservationRegistrar`` when using the
/// ``OpenObservation/Observable()`` macro to indicate observably
/// of a type.
public init() {
}
Expand Down
Loading