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

Expose model container, refactor throwing functions. #7

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

Conversation

ynechaev
Copy link

This PR introduces separate internal interfaces for live and preview model container and context. This separation is being incapsulated behind built-in TCA's feature: live and preview implementations.

Here is a list of changes:

  • Add container API to the Database
  • Remove throwing from add and delete MovieDatabase functions due to redundancy.
  • Fix ContentView preview and functionality by removing no-op handler from preview operator and supplying modelContainer prior to view rendering.

From now on you can use container function if you need to supply it to a SwiftUI view with .modelContainer(_:) modifier.

context() function remains accessible for backwards compatibility.

@ynechaev
Copy link
Author

ynechaev commented Apr 7, 2024

@SouzaRodrigo61 any comments?

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.

1 participant