Extensions on
Storage
Methods
transient()
static func transient<I: Storable>() -> Self where Self == TransientStorage<I>
Compose an instance of TransientStorage
.
Returns
An instance of Self
.
userDefaults(_:)
static func userDefaults<I: Storable>(_ userDefaults: UserDefaults = .standard) -> Self
where Self == UserDefaultsStorage<I>
Compose an instance of UserDefaultsStorage
.
Parameters
Name | Type | Description |
---|---|---|
userDefaults | UserDefaults |
Some |
Returns
An instance of Self
.
eraseToAnyStorage()
func eraseToAnyStorage() -> AnyStorage<Item>
Type-erase the current instance.
Returns
A valid AnyStorage
.