Skip to content

Commit

Permalink
moved _fetchLinkouts out of render and into an override for attribute…
Browse files Browse the repository at this point in the history
…ChangedCallback. github#31
  • Loading branch information
ctcncgr committed Mar 20, 2023
1 parent 3de00c4 commit a561522
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lis-linkout-search-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export class LisLinkoutSearchElement extends LitElement {
return this;
}

override attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null) {
console.log('attribute change: ', name, newVal);
super.attributeChangedCallback(name, oldVal, newVal);
this._fetchLinkouts();
}

/**
* The query string for the linkout service.
*
Expand Down Expand Up @@ -98,7 +104,6 @@ export class LisLinkoutSearchElement extends LitElement {
override render() {

// compute table parts
this._fetchLinkouts();
const dataAttributes = ['linkout']
const header = {'linkout': 'Linkouts'};
// draw the table
Expand Down

0 comments on commit a561522

Please sign in to comment.