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

refactor: hyperParams generation from a single source #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Shivam25092001
Copy link
Contributor

REFACTOR

  • Change hyperParams generation to a single function with cached values.

"launchTime": Int(Date().timeIntervalSince1970 * 1000)
]

if let defaultView = defaultView {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we doing this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please explain the need of passing defaultView, why cant we keep it hardcoded as mentioned earlier ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the file /PaymentSheetView.swift we need the property of defaultView, in all other cases we don't need to pass in defaultView prop.
That's why, exposed defaultView as an optional parameter.

private let deviceModel = UIDevice.current.model
private let osVersion = UIDevice.current.systemVersion

func getHyperParams(defaultView: Bool? = nil) -> [String: Any?] {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serve from class not function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants