Skip to content
Discussion options

You must be logged in to vote

When we use observable models in our demos, they mostly map to TCA reducers:

  • The view holds onto a store instead of the model,
  • It accesses store state instead of model properties, and
  • It sends actions to the store instead of invoking model methods

Otherwise things look mostly the same. So you could take the SyncUps demo, which uses observable models, and consider how it would be ported.

But the bottom line is you can use @FetchAll (and @FetchOne and @Fetch) wherever you want, or wherever @Shared properties are held. This includes reducer state, effects, even directly in a view if you want. And you can use @Dependency(\.defaultDatabase) to write to the database.

Let us know if you hit an…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by jaredh159
Comment options

You must be logged in to vote
2 replies
@mbrandonw
Comment options

@lukesutton
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants