Conversation
- this breaks View when dynamically toggling sort bar on an already loaded collection browser
|
| * No need to fetch if placeholder is being displayed | ||
| */ | ||
| if (!model && !this.isScrollingToCell) { | ||
| if (!this.placeholderType && !model && !this.isScrollingToCell) { |
There was a problem hiding this comment.
this block fires even though we render the placeholder. this reduces fetch checks since we request details for each result...
… on empty base query
|
|
||
| private async showEmptyPlaceholder(placeholderType: string) { | ||
| switch (placeholderType) { | ||
| case 'empty query': |
There was a problem hiding this comment.
I know we are on demo for developers but we should not use string slugs for checking conditions. I would write these something like empty-query, empty-collection, empty-profile something like this.
| if (!model && !this.isScrollingToCell) { | ||
| if (!this.placeholderType && !model && !this.isScrollingToCell) { | ||
| const pageNumber = Math.floor(offsetIndex / this.pageSize) + 1; | ||
| console.warn('****** FETCH PAGE tileModelAtCellIndex', { |
There was a problem hiding this comment.
can you please our custom log() function to render logs messages for development purpose?
There was a problem hiding this comment.
yes I can remove these, actually once we get stable work on offshoot 👍
| } | ||
|
|
||
| willUpdate() { | ||
| this.setPlaceholderType(); |
There was a problem hiding this comment.
Just curious, when willUpdate() function executes? (still learning)
| this.baseQuery, | ||
| JSON.stringify(this.selectedFacets) | ||
| ); | ||
| console.log('CB will reset', { |
There was a problem hiding this comment.
let's add our log() util function here.
f0b9733 to
e46fed6
Compare
12f72f6 to
2b23159
Compare
setPlaceholdercall out of lifecycle since it is an anti-patternwillUpdatelifecycle - as a render cycle will be called & any state set there will not re-trigger loadTesting: https://internetarchive.github.io/iaux-collection-browser/pr/pr-337
👍