Skip to content

Conversation

@meltsplit
Copy link
Contributor

Hi!
I am studying the example apps by referring to the tutorial.
I standardized the App.swift file.

Changes made:

  • Refactored: Declared the store as static to prevent interference with Xcode previews.
  • Added: Added an if isTesting condition to prevent interference between the app and the test.

I hope this change will help developers understand the testing and preview mechanisms better.

Copy link
Member

@stephencelis stephencelis left a comment

Choose a reason for hiding this comment

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

@meltsplit Thanks for the PR! I think we'd definitely take the static change but I've made a few suggestions in one of the examples. Want to apply them to the rest? Then we'll be happy to merge your contributions 😄

Comment on lines 6 to 7

@MainActor
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this is needed since the App protocol is @MainActor.

Suggested change
@MainActor

Comment on lines 15 to 19
if isTesting {
EmptyView()
} else {
SearchView(store: Self.store)
}
Copy link
Member

Choose a reason for hiding this comment

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

Since we're not doing UI tests I think we can simplify:

Suggested change
if isTesting {
EmptyView()
} else {
SearchView(store: Self.store)
}
SearchView(store: Self.store)

@meltsplit meltsplit force-pushed the declare-store-as-static branch from e63ad43 to 0b11dff Compare March 7, 2025 09:46
@meltsplit
Copy link
Contributor Author

Thanks. @stephencelis
I apply your suggestions.

I also removed @MainActor from SyncUps that I didn't change at the first PR. (0b11dff)
Is there any reason to keep @MainActorin SyncUps/App.swift?

@stephencelis
Copy link
Member

Thanks!

@meltsplit
Copy link
Contributor Author

@stephencelis
I fixed the method name that caused CI failure.

@meltsplit meltsplit changed the title [Examples] declare store as static to avoid interference with Xcode previews [Examples] Declare store as static to avoid interference with Xcode previews Mar 9, 2025
@mbrandonw mbrandonw merged commit 6b2f62e into pointfreeco:main Mar 12, 2025
6 of 15 checks passed
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.

3 participants