Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
igv.createBrowser(this.el, browserConfig).then(browser => {
if (this.mounted === false) {
igv.removeBrowser(browser)
return
}
this.browser = browser
const resetButton = document.createElement('i')
resetButton.className = 'igv-app-icon'
resetButton.innerText = '⟲'
resetButton.title = 'Reset'
resetButton.style.cssText = `
position: relative;
top: -1px;
font-style: normal;
font-size: 14px;
font-weight: bold;
margin: 0 10px;
componentWillUnmount() {
if (this.browser) {
igv.removeBrowser(this.browser)
}
this.mounted = false
}
componentDidMount() {
const { config, onCreateBrowser } = this.props
const browserConfig = {
...config,
promisified: true,
}
igv.createBrowser(this.el, browserConfig).then(browser => {
if (this.mounted === false) {
igv.removeBrowser(browser)
return
}
this.browser = browser
const resetButton = document.createElement('i')
resetButton.className = 'igv-app-icon'
resetButton.innerText = '⟲'
resetButton.title = 'Reset'
resetButton.style.cssText = `
position: relative;
top: -1px;
font-style: normal;
font-size: 14px;