How to add a conditional wait on an element with JS-TestCafe?

How can I add a conditional wait on an element with JS-TestCafe?

Hello Tim,

To add a conditional wait on an element with JS-TestCafe, use the below code:

const EC = protractor.ExpectedConditions;

waitForElement = async () => {
    const present = await yourElement.isPresent();
    if (present) {
        await browser.wait(EC.elementToBeClickable(yourElement));
        await yourElement.sendKeys('something');
    }
};