I'm trying to deal with promise as described by Vibrant.js while formatting the response. It should return
When I output the response to the console with the following code it works fine.
function main(imageURL) {
Vibrant.from(imageURL).getPalette()
.then((palette) => console.log(palette))
}
However, I want to format the response through another function. So I have the following but the console does not long anything.
function main(imageURL) {
Vibrant.from(imageURL).getPalette()
.then((palette) => formattedPalette(palette))
}
function formattedPalette(palette) {
return palette
}
main();
console.log(main())
I'm obviously missing something while chaining events.