Skip to content

Commit

Permalink
Refactor FXIOS-9417 Descriptive debug for Redux Actions #20853
Browse files Browse the repository at this point in the history
  • Loading branch information
mattreaganmozilla authored Jun 29, 2024
1 parent ef65122 commit bd589c1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion BrowserKit/Sources/Redux/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
import Common

/// Used to describe an action that can be dispatched by the redux store
open class Action {
open class Action: CustomDebugStringConvertible {
public var windowUUID: WindowUUID
public var actionType: ActionType

Expand All @@ -19,6 +19,12 @@ open class Action {
let className = String(describing: Self.self)
return "\(className) \(actionType)"
}

public var debugDescription: String {
let className = String(describing: type(of: self))
let memAddr = Unmanaged.passUnretained(self).toOpaque()
return "<\(className): \(memAddr)> Type: \(actionType) Window: \(windowUUID.uuidString.prefix(4))"
}
}

public protocol ActionType {}

0 comments on commit bd589c1

Please sign in to comment.