@idle
Wrap function in Async.requestIdleCallback wrapper
import { component, idle } from 'jodit/core/decorators';
import { UIElement } from 'jodit/ui';
@component
class SomeClass extends UIElement {
@idle
runIdle(): void {
// Do some havy work
this.runIdle(); // This will work and won't go into stack depth error and break the main thread
}
}
idle
idle<V>(): DecoratorHandler
Type parameters
| Name | Type |
|---|---|
V |
extends IComponent<IViewBased<IViewOptions>> = IComponent<IViewBased<IViewOptions>> |
Returns
Defined in
jodit/src/core/decorators/idle/idle.ts:18
Previous
Next