Logo iconXDSoft.net
  • Jodit
  • Examples
  • Playground
  • Builder
  • Jodit PRO
  • Github
Jodit Editor
  • Overview
  • Getting Started
  • Button System
  • Jodit Awesome
  • Options
  • Contributing guide
  • Plugin System
  • Modules
    • Async
    • Component system
    • Constants
    • Context menu
    • Create DOM
    • Decorators
      • @autobind
      • @cache
      • @component
      • @debounce and @throttle
      • @derive
      • @hook
      • @idle
      • @nonenumerable
      • @persistent
      • @wait
      • @watch
    • Dialog system
    • DOM operation
    • Event Emitter
    • Filebrowser
    • Global
    • Helpers
    • History
    • Icon system
    • Image editor
    • Jodit constructor
    • Langs
    • Show info messages
    • Plugins
    • Request
    • Selection
    • Status bar
    • Persistent storage
    • Table processor
    • Toolbar
    • Traits
    • Types
    • UI System
    • File uploader module
    • View UI component
    • Jodit widgets
  • Classes
  • Interfaces

@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
  }
}

idleidle

idle<V>(): DecoratorHandler

Type parametersType parameters

Name Type
V extends IComponent<IViewBased<IViewOptions>> = IComponent<IViewBased<IViewOptions>>

ReturnsReturns

DecoratorHandler

Defined inDefined in

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

Previous
@hook
Next
@nonenumerable