Skip to content

Commit dd39794

Browse files
committed
Relax onMainActor route closures to not require Sendable
1 parent b3859f8 commit dd39794

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

MobiusCore/Source/EffectHandlers/EffectRouterDSL.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Spotify AB.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import Foundation
4+
import Dispatch
55

66
public extension EffectRouter where Effect: Equatable {
77
/// Add a route for effects which are equal to `constant`.
@@ -78,7 +78,7 @@ public extension _MainActorPartialEffectRouter {
7878
/// Dispatches through the `.on(queue: .main)` path and assumes actor isolation once scheduled on the main queue.
7979
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
8080
func to(
81-
_ fireAndForget: @MainActor @Sendable @escaping (EffectParameters) -> Void
81+
_ fireAndForget: @MainActor @escaping (EffectParameters) -> Void
8282
) -> EffectRouter<Effect, Event> {
8383
return partialRouter.to { parameters, callback in
8484
MainActor.assumeIsolated {
@@ -96,7 +96,7 @@ public extension _MainActorPartialEffectRouter where EffectParameters == Void {
9696
/// Dispatches through the `.on(queue: .main)` path and assumes actor isolation once scheduled on the main queue.
9797
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
9898
func to(
99-
_ fireAndForget: @MainActor @Sendable @escaping () -> Void
99+
_ fireAndForget: @MainActor @escaping () -> Void
100100
) -> EffectRouter<Effect, Event> {
101101
return partialRouter.to { _, callback in
102102
MainActor.assumeIsolated {

0 commit comments

Comments
 (0)