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

Remove dependency of requests on Session/Element for layering #67

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

tristanlabelle
Copy link
Contributor

@tristanlabelle tristanlabelle commented Aug 26, 2023

There's a conceptual layering in the codebase where the Session and Element structs can be built on top of Request structs, but this is not apparent because Request structs refer to Session/Element types. This refactoring is a step towards making this layering explicit. A follow-up will be to pull the requests in separate files.

  • Replace Request dependencies on Session/Element with strings
  • Make Request struct properties var instead of let for more swiftiness
  • Rename ***Request variables to request since the type is apparent from the context
  • Changed all var body properties to computed properties based on fields of the request

Copy link
Contributor

@jeffdav jeffdav left a comment

Choose a reason for hiding this comment

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

Love it.

Sources/Element+Request.swift Show resolved Hide resolved
Sources/Element+Request.swift Show resolved Hide resolved
Sources/Element+Request.swift Outdated Show resolved Hide resolved
@tristanlabelle tristanlabelle merged commit 0d619b6 into main Aug 28, 2023
1 check passed
@tristanlabelle tristanlabelle deleted the tristan/requests-layer branch August 28, 2023 16:12
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