Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
KazaiMazai committed Apr 13, 2024
1 parent ffacc8c commit 2622810
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 12 additions & 0 deletions Sources/Puredux/Store/Core/ActionsInterceptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ struct ScopedAction<Action> {
let action: Action
}

struct ActionsMapping<GlobalAction, LocalAction> {
let toGlobal: (LocalAction) -> GlobalAction
let toLocal: (GlobalAction) -> LocalAction

static func passthrough<A>() -> ActionsMapping<A, A> {
ActionsMapping<A, A>(
toGlobal: { $0 },
toLocal: { $0 }
)
}
}

struct ActionsInterceptor<Action> {
let storeId: StoreID
let handler: (Action, @escaping Dispatch<Action>) -> Void
Expand Down
11 changes: 0 additions & 11 deletions Sources/Puredux/Store/Core/ActionsMapping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,3 @@

import Foundation

struct ActionsMapping<GlobalAction, LocalAction> {
let toGlobal: (LocalAction) -> GlobalAction
let toLocal: (GlobalAction) -> LocalAction

static func passthrough<A>() -> ActionsMapping<A, A> {
ActionsMapping<A, A>(
toGlobal: { $0 },
toLocal: { $0 }
)
}
}

0 comments on commit 2622810

Please sign in to comment.