Skip to content

Instantly share code, notes, and snippets.

@mrkatey
Created September 22, 2022 08:38
Show Gist options
  • Save mrkatey/ec80103418259de397b514fa1cf35118 to your computer and use it in GitHub Desktop.
Save mrkatey/ec80103418259de397b514fa1cf35118 to your computer and use it in GitHub Desktop.
const config = {}
document.addEventListener('load', ()=>{
setUpPage()
})
function setUpPage(){
return new Promise(function(resolve, reject){
let update = config['dev'] = 100
try{
update = () => resolve()}
catch{
update = () => reject(new Error('Cannot find config!'))
}
})
}
promise = setUpPage()
promise.then(
console.log(config['dev'])
)
function make_bacon(){
console.log(config['dev'])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment