JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

JavaScript

class X {
	get someVal() {
  	return doX().then(doZ);
  }
}

async function doX() {
	return Promise.resolve();
}

async function doY() {
	return Promise.resolve('do y done');
}

async function doZ() {
	return Promise.resolve('do z done');
}

const x = new X();
x.someVal.then(r => {
	console.log('resolved value: ', r);
});