0

I am working on a project that includes a list of Help Articles.

Clicking on an Article in the list opens the Article.

OnInitializedAsync() calls to the API for the Article.include(Comments).theninclude(Replies).

I have a CommentList component that builds the comment list using instances of Comment component

Each Comment has a ReplyList component that builds a reply list using instances of Reply component

The page is built:

  • Article API Call including Comments then Replies
  • CommentList [Parameter] public <ArticleDto> Article
  • Comment instances [Parameter] public <CommentDto> Comment
  • ReplyList [Parameter] public <ReplyDto> Reply
  • Reply instances [Parameter] public <ReplyDto> Reply

The page is slow to render with a lot of foreach and if checks so I'm left wondering if my approach is a bit immature?

If you've faced this dilemma, I'd love to hear what your approach was.

I'm considering having each list component make its own API call but I was hoping to avoid multiple calls to build a single page. Virtualization seems like a good candidate perhaps?

2
  • could be slow because of latency, db calls, try to replace your db data with fake static data you create in a for loop, obviously showing 1k records at once will also be slow, fot that you can use paging Commented Feb 10, 2022 at 22:49
  • 1
    Thanks, @buga it's all running local with avg 38ms latency. Adjusting the hierarchy of the components and refining conditional loops along with fewer EventCallbacks has resolved the issue. Commented Feb 14, 2022 at 5:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.