Skip to content

Commit

Permalink
Added callback function support to both dataset and gene collection w…
Browse files Browse the repository at this point in the history
…idget loading
  • Loading branch information
jorvis committed Jan 14, 2024
1 parent 5106a26 commit da883fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ document.addEventListener('DOMContentLoaded', () => {
});
});

const fetchDatasetCollections = async () => {
const fetchDatasetCollections = async (callback) => {
try {
dataset_collection_data = await apiCallsMixin.fetchDatasetCollections();
document.querySelector('#dropdown-dc').classList.remove('is-loading');
Expand All @@ -119,6 +119,7 @@ const fetchDatasetCollections = async () => {
}
}

callback();

} catch (error) {
console.error(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ document.addEventListener('DOMContentLoaded', () => {
});
});

const fetchGeneCartData = async () => {
const fetchGeneCartData = async (callback) => {
try {
gene_cart_data = await apiCallsMixin.fetchGeneCarts('unweighted-list');
document.querySelector('#dropdown-gene-lists').classList.remove('is-loading');
Expand All @@ -157,6 +157,8 @@ const fetchGeneCartData = async () => {
gene_cart_label_index[cart.share_id] = cart.label;
}
}

callback();

} catch (error) {
console.error(error);
Expand Down

0 comments on commit da883fd

Please sign in to comment.