Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add label to .on(queue:) #157

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion MobiusCore/Source/EffectHandlers/EffectRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ public struct _PartialEffectRouter<Effect, EffectParameters, Event> {

/// Handle an the current `Effect` asynchronously on the provided `DispatchQueue`
///
/// Warning: Dispatching events to a loop from a different queue is not a thread-safe operation and will require
/// manual synchronization unless the loop is run in a `MobiusController`.
/// See: [Using MobiusController](https://github.com/spotify/Mobius.swift/wiki/Using-MobiusController).
///
///
/// - Parameter queue: The `DispatchQueue` that the current `Effect` should be handled on.
public func on(_ queue: DispatchQueue) -> Self {
public func on(queue: DispatchQueue) -> Self {
return Self(routes: routes, path: path, queue: queue)
}
}
Expand Down
2 changes: 1 addition & 1 deletion MobiusCore/Test/EffectHandlers/EffectRouterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class EffectRouterTests: QuickSpec {
var ranOnTestQueue = false
let connection = EffectRouter<Effect, Event>()
.routeCase(.effect1)
.on(testQueue)
.on(queue: testQueue)
.to {
dispatchPrecondition(condition: .onQueue(testQueue))
ranOnTestQueue = true
Expand Down