Skip to content

Commit

Permalink
minor browser API cleanup - remove async from getUserDefinedROIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Jul 24, 2024
1 parent 23a976a commit ec7b3df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
18 changes: 0 additions & 18 deletions dev/trackTypes.md

This file was deleted.

14 changes: 7 additions & 7 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ class Browser {
* @returns {Promise<void>}
*/
async loadROI(config) {
await this.roiManager.loadROI(config, this.genome)
return this.roiManager.loadROI(config, this.genome)
}

/**
Expand All @@ -1164,16 +1164,16 @@ class Browser {
/**
* Public API function. Return a promise for the list of user-defined regions-of-interest
*/
async getUserDefinedROIs() {
getUserDefinedROIs() {

if (this.roiManager) {

const set = await this.roiManager.getUserDefinedROISet()
const set = this.roiManager.getUserDefinedROISet()
if (undefined === set) {
return []
}

const featureHash = await set.getAllFeatures()
const featureHash = set.getAllFeatures()
const featureList = []
for (let value of Object.values(featureHash)) {
featureList.push(...value)
Expand Down Expand Up @@ -1824,14 +1824,14 @@ class Browser {
/**
* Search for the locus string
* NOTE: This is part of the API
* @param string
* @param stringOrArray
* @param init true if called during browser initialization
*
* @returns {Promise<boolean>} true if found, false if not
*/
async search(string, init) {
async search(stringOrArray, init) {

const loci = await search(this, string)
const loci = await search(this, stringOrArray)

if (loci && loci.length > 0) {

Expand Down
2 changes: 1 addition & 1 deletion js/roi/ROIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class ROIManager {
}
}

async getUserDefinedROISet() {
getUserDefinedROISet() {
return this.roiSets.find(roiSet => true === roiSet.isUserDefined)
}

Expand Down

0 comments on commit ec7b3df

Please sign in to comment.