EXTENSION
PrimitiveSequenceType
Methods
dispatch(action:on:mode:fillOnError:)
func dispatch<A: CompletableAction>(action: A.Type,
on dispatcher: Dispatcher,
mode: Dispatcher.DispatchMode.UI = .async,
fillOnError errorPayload: A.Payload? = nil)
-> Disposable where A.Payload == Self.Element
Dispatches an given action from the result of the
Singletrait. This is only usable when theActionis aCompletableAction.
- Parameter action: The
CompletableActiontype to be dispatched.- Parameter dispatcher: The
Dispatcherobject that will dispatch the action.- Parameter mode: The
Dispatcherdispatch mode,.asyncby default.- Parameter fillOnError: The payload that will replace the action’s payload in case of failure.
Parameters
| Name | Description |
|---|---|
| action | The CompletableAction type to be dispatched. |
| dispatcher | The Dispatcher object that will dispatch the action. |
| mode | The Dispatcher dispatch mode, .async by default. |
| fillOnError | The payload that will replace the action’s payload in case of failure. |
dispatch(action:key:on:mode:fillOnError:)
func dispatch<A: KeyedCompletableAction>(action: A.Type,
key: A.Key,
on dispatcher: Dispatcher,
mode: Dispatcher.DispatchMode.UI = .async,
fillOnError errorPayload: A.Payload? = nil)
-> Disposable where A.Payload == Self.Element
Dispatches an given action from the result of the
Singletrait. This is only usable when theActionis aCompletableAction.
- Parameter action: The
CompletableActiontype to be dispatched.- Parameter key: The key associated with the
Taskresult.- Parameter dispatcher: The
Dispatcherobject that will dispatch the action.- Parameter mode: The
Dispatcherdispatch mode,.asyncby default.- Parameter fillOnError: The payload that will replace the action’s payload in case of failure or
nil.
Parameters
| Name | Description |
|---|---|
| action | The CompletableAction type to be dispatched. |
| key | The key associated with the Task result. |
| dispatcher | The Dispatcher object that will dispatch the action. |
| mode | The Dispatcher dispatch mode, .async by default. |
| fillOnError | The payload that will replace the action’s payload in case of failure or nil. |
action(_:fillOnError:)
func action<A: CompletableAction>(_ action: A.Type,
fillOnError errorPayload: A.Payload? = nil)
-> Single<A> where A.Payload == Self.Element
Builds a
CompletableActionfrom aSingle
- Parameter action: The
CompletableActiontype to be built.- Parameter fillOnError: The payload that will replace the action’s payload in case of failure or
nil.- Returns: A
Singleof theCompletableActiontype declared by the action parameter.
Parameters
| Name | Description |
|---|---|
| action | The CompletableAction type to be built. |
| fillOnError | The payload that will replace the action’s payload in case of failure or nil. |
dispatch(action:on:mode:)
func dispatch<A: EmptyAction>(action: A.Type,
on dispatcher: Dispatcher,
mode: Dispatcher.DispatchMode.UI = .async)
-> Disposable
Dispatches an given action from the result of the
Completabletrait. This is only usable when theActionis anEmptyAction.
- Parameter action: The
CompletableActiontype to be dispatched.- Parameter dispatcher: The
Dispatcherobject that will dispatch the action.- Parameter mode: The
Dispatcherdispatch mode,.asyncby default.
Parameters
| Name | Description |
|---|---|
| action | The CompletableAction type to be dispatched. |
| dispatcher | The Dispatcher object that will dispatch the action. |
| mode | The Dispatcher dispatch mode, .async by default. |
action(_:)
func action<A: EmptyAction>(_ action: A.Type)
-> Single<A>
Builds an
EmptyActionfrom aCompletable
- Parameter action: The
EmptyActiontype to be built.- Returns: A
Singleof theEmptyActiontype declared by the action parameter.
Parameters
| Name | Description |
|---|---|
| action | The EmptyAction type to be built. |