Enumeration Casepointfreeco.swift-sharing 2.3.0Sharing
userInitiated
The value is being loaded explicitly (via load
, load(_:)
, or init(require:)
).
case userInitiated
The value is being loaded explicitly (via load
, load(_:)
, or init(require:)
).
case userInitiated
import Sharing
Instantly share state among your app’s features and external persistence layers, including user defaults, the file system, and more.
enum LoadContext<Value>
The context in which a value is loaded by a SharedReaderKey
.
func load() async throws
Requests an up-to-date value from an external source.
func load(_ key: some SharedReaderKey<Value>) async throws
Replaces a shared reference’s key and attempts to load its value.
init(require key: some SharedReaderKey<Value>) async throws
Creates a shared reference to a read-only value using a shared key by loading it from its external source.
case initialValue(Value)
The value is being loaded implicitly at the initialization of a @Shared
or @SharedReader
property (via init(wrappedValue:_:)
).