LazyWalker

dom.LazyWalker

Class for adding event handling capability

class SomeClass extends Eventify<{ start: (node: Node) => boolean; }> {
  constructor() {
    super();
    setTimeout(() => {
      if (this.emit('start', document.body)) {
        console.log('yes');
      };
    }, 100);
  }
}

const sm = new SomeClass();
sm.on('start', (node) => {
  console.log(node);
  return true;
})

Hierarchy

  • Eventify<{ visit: (node: Node) => boolean ; break: (reason?: string) => void ; end: (affect: boolean) => void }>

    LazyWalker

Implements

constructor

new LazyWalker(async, options?): LazyWalker

Parameters

Name Type
async IAsync
options Object
options.timeout? number
options.whatToShow? number
options.reverse? boolean
options.timeoutChunkSize? number

Returns

LazyWalker

Overrides

Eventify.constructor

Defined in

src/core/dom/lazy-walker.ts#42

setWork

setWork(root): this

Parameters

Name Type
root Node

Returns

this

Defined in

src/core/dom/lazy-walker.ts#26


break

break(reason?): void

Parameters

Name Type
reason? string

Returns

void

Defined in

src/core/dom/lazy-walker.ts#62


end

end(): void

Returns

void

Defined in

src/core/dom/lazy-walker.ts#69


destruct

destruct(): void

Returns

void

Implementation of

IDestructible.destruct

Overrides

Eventify.destruct

Defined in

src/core/dom/lazy-walker.ts#84


on

on(name, func): this

Parameters

Name Type
name "visit" | "break" | "end"
func (node: Node) => boolean | (reason?: string) => void | (affect: boolean) => void

Returns

this

Inherited from

Eventify.on

Defined in

src/core/event-emitter/eventify.ts#42


off

off(name, func): this

Parameters

Name Type
name "visit" | "break" | "end"
func (node: Node) => boolean | (reason?: string) => void | (affect: boolean) => void

Returns

this

Inherited from

Eventify.off

Defined in

jodit/src/core/event-emitter/eventify.ts:52