-
Notifications
You must be signed in to change notification settings - Fork 0
LoadableForEachEnvironment
m-housh edited this page Aug 20, 2021
·
1 revision
Represents the environment for a LoadableForEach
view.
public struct LoadableForEachEnvironment<Element, Id: Hashable, LoadRequest, Failure: Error>
Create a new environment.
public init(
load: @escaping (LoadRequest) -> Effect<IdentifiedArray<Id, Element>, Failure>,
mainQueue: AnySchedulerOf<DispatchQueue>
)
- load: Load the elements.
- mainQueue: The main dispatch queue.
Wraps a LoadableListEnvironment
and returns an IdentifiedArray
to be used in for each stores.
public init(
id: KeyPath<Element, Id>,
environment listEnvironment: LoadableListEnvironment<Element, LoadRequest, Failure>
)
- id: The key path to the id of the element.
- listEnvironment: The list environment to derive our
load
method from.
Wraps a LoadableListEnvironment
and returns an IdentifiedArray
to be used in for each stores, when the element is Identifiable
.
public init(
environment listEnvironment: LoadableListEnvironment<Element, LoadRequest, Failure>
) where Element: Identifiable, Id == Element.ID
- listEnvironment: The list environment to derive our
load
method from.
Wraps a LoadableEnvironmentRepresentable
in a LoadableForEachEnvironment
.
public init<Environment: LoadableEnvironmentRepresentable>(
environment loadableEnvironment: Environment
)
where
Environment.LoadedValue == IdentifiedArray<Id, Element>,
Environment.Failure == Failure,
Environment.LoadRequest == LoadRequest
- loadableEnvironment: The loadable environment to transform to a for each environment.
Load the elements.
public var load: (LoadRequest) -> Effect<IdentifiedArray<Id, Element>, Failure>
The main dispatch queue.
public var mainQueue: AnySchedulerOf<DispatchQueue>
DEBUG
-
A concrete
LoadableForEachEnvironment
that fails.public static var failing: Self
A concrete LoadableForEachEnvironment
that does nothing.
public static var noop: Self
Generated at 2021-08-23T22:43:49+0000 using swift-doc 1.0.0-rc.1.
Types
- EditButton
- EditMode
- EditModeAction
- EmptyLoadRequest
- ListAction
- LoadError
- Loadable
- LoadableAction
- LoadableEnvironment
- LoadableForEachAction
- LoadableForEachEnvironment
- LoadableForEachState
- LoadableForEachStore
- LoadableList
- LoadableListAction
- LoadableListEnvironment
- LoadableListState
- LoadablePicker
- LoadablePickerAction
- LoadablePickerEnvironment
- LoadablePickerState
- LoadableView
- User
- UserAction