View checkPermissions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean checkPermissions() | |
{ | |
// validDate is necessary in order for a permission to be valid. | |
return prem.validDate == currentDate && | |
prem.allowedToFetch(id) && | |
prem.type == PremissionType.Admin; | |
} |
View promise1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
funcation someOperation(){ | |
return Promise.all(getDogs(), getCats()) | |
.then([dogs, cats] => makeItRain(cats, dogs)) | |
.then(openAnimalProffUmbrella); | |
} |
View 1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function doStuff(){ | |
try { | |
const result = await rainSomeCatsAndDogs(); | |
return result(); | |
} catch(someCatsAndDogs) { | |
// do something; | |
} | |
} |
View 2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function doStuff(){ | |
try { | |
return await rainSomeCatsAndDogs(); | |
} catch(someCatsAndDogs) { | |
// do something; | |
} | |
} |
View 3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rainSomeCatsAndDogs(){ | |
return Promise.all([getDogs(), getCats()]) | |
.then([dogs, cats] => makeItRain(cats, dogs)) | |
.then(openAnimalProffUmbrella); | |
} |
View 4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function rainSomeCatsAndDogs() { | |
const dogs = await getDogs(); | |
const cats = await getCats(); | |
await makeItRain(cats, dogs); | |
await openAnimalProffUmbrella(); | |
} |
View 5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function rainSomeCatsAndDogs() { | |
const [dogs, cats] = await Promise.all([getDogs(), getCats()]); | |
await makeItRain(cats, dogs); | |
await openAnimalProffUmbrella(); | |
} |
View 6.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function rainSomeCatsAndDogs() { | |
const dogsPromise = getDogs(); | |
const catsPromise = getCats(); | |
const [dogs, cats] = [await dogsPromise, await catsPromise]; | |
await makeItRain(cats, dogs); | |
await openAnimalProffUmbrella(); | |
} |
View 7.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function rainSomeCatsAndDogs() { | |
const [dogs, cats] = await Promise.all([getDogs(), getCats()]); | |
await makeItRain(cats, dogs); | |
await openAnimalProffUmbrella(); | |
} |
View x.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function doStuff(){ | |
try { | |
return rainSomeCatsAndDogs(); | |
} catch(someCatsAndDogs) { | |
// do something; | |
} | |
} |
OlderNewer