From 96f54e3f36cd7102105cdac47885fd9bcb7488e3 Mon Sep 17 00:00:00 2001 From: Zach Date: Tue, 24 Sep 2024 17:22:24 -0600 Subject: [PATCH] Update usage-overview.md --- documentation/usage-overview.md | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/documentation/usage-overview.md b/documentation/usage-overview.md index d0fd34a..a5a7221 100644 --- a/documentation/usage-overview.md +++ b/documentation/usage-overview.md @@ -105,31 +105,6 @@ print(username) // Prints "New Username" This example demonstrates how to access and modify a specific slice of application state. -## Publisher and Subscribing - -`Publisher` allows objects to subscribe to changes in state or data. Subscribers are notified whenever the publisher's data changes. - -### Example - -```swift -import AppState - -class MySubscriber: Subscribing { - typealias Value = String - - func didUpdate(newValue: String?) { - print("New value: \(String(describing: newValue))") - } -} - -let subscriber = MySubscriber() -let publisher = Publisher(initialValue: "Initial value", subscribers: [subscriber]) - -publisher.value = "Updated value" // Prints "New value: Updated value" -``` - -This example shows how to create a reactive system where objects respond to state changes. - ## Next Steps For more in-depth details on each component, refer to the specific usage guides: