Skip to content
Discussion options

You must be logged in to vote

Having modeled things this way, I recommend against it. It seems more efficient, but creating the child features, and then each of them holding an observation to the database becomes expensive.

Instead, bring the parent and child features together.

  1. Parent fetches all data. Use a @Selection to narrow to just the fields you need
  2. ForEach those rows directly for the view.
  3. The parent receives all actions and takes the ID of the row, for example case buttonTapped(Row.ID)

Then, if you truly need pagination here's what I do:

  1. Fetch just the id for all records
  2. Observe the view for which ids are on screen. I do this in an NSCollectionView which provides that data
  3. Fetch full data for that set of ids.

Replies: 2 comments 9 replies

Comment options

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

You must be logged in to vote
9 replies
@rcarver
Comment options

@cameronmcefee
Comment options

@cameronmcefee
Comment options

@rcarver
Comment options

@cameronmcefee
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants