@wait

Wrap function in wait wrapper, it will be called after condition returns true

import { component, wait } from 'jodit/core/decorators';
import { UIElement } from 'jodit/ui';

@component
class UISomeElement extends UIElement {
  @wait(() => typeof jQuery !== 'undefined')
  protected runOnLoadJQuery(html: string): void {
    jQuery(this.container).html(html);
    alert('Run');
  }
}

const elm = new UISomeElement(jodit);
elm.runOnLoadJQuery('<h1>One</h1>'); // Do nothing
// jQuery is loaded
// alert

wait

wait<T>(condition): Function

Type parameters

Name Type
T extends IViewBased<IViewOptions>

Parameters

Name Type
condition (ctx: T) => boolean

Returns

Function

Defined in

jodit/src/core/decorators/wait/wait.ts:18

wait<T>(condition): Function

Type parameters

Name Type
T extends IViewComponent<IViewBased<IViewOptions>>

Parameters

Name Type
condition (ctx: T) => boolean

Returns

Function

Defined in

jodit/src/core/decorators/wait/wait.ts:21