Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Oct 21, 2024
1 parent 4b4d36c commit 4a4c53a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Sources/Verge/Store/AnyTargetQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,17 @@ public enum Queues {
private let executor: BackgroundActor = .init()

public func execute(_ workItem: sending @escaping @Sendable () -> Void) {
Task {
await executor.perform {
workItem()
}
Task { [executor, workItem] in
await executor.perform(workItem)
}
}

private actor BackgroundActor: Actor {

init() {

}

func perform<R>(_ operation: sending @Sendable () throws -> R) rethrows -> R {
try operation()
}
Expand All @@ -237,4 +235,3 @@ public enum Queues {
}

}

2 changes: 1 addition & 1 deletion Sources/Verge/Store/UIStateStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// A store that optimized for only using in UI thread.
/// No using locks.
@MainActor
public final class UIStateStore<State: Equatable, Activity>: Store<State, Activity> {
public final class UIStateStore<State: Equatable, Activity: Sendable>: Store<State, Activity> {

public nonisolated init(
initialState: State,
Expand Down

0 comments on commit 4a4c53a

Please sign in to comment.