This is a baby step.
I was trying to write a dummy function to mock the behaviour of an API get request, so it needs to be a promise that resolves to an array.
This is the code:

1
2
3
4
5
6
const pretendStr = 'i-am-a-sharable-link-for-trip';
function generateJoinString(tripID) {
return new Promise(function(resolve) {
setTimeout(resolve.bind(null, `${pretendStr}${tripID}`), 400);
});
}

This Promise will resolve to ${pretendStr}${tripID} after 400ms.

Will work further on dealing with Promise objects later.