Skip to content

BlockSuite API Documentation / @blocksuite/blocks / once

Function: once()

once(element, event, handler, options)

once<T, K, M>(element, event, handler, options?): () => void

Type parameters

T extends HTMLElement

K extends string | number | symbol

M = HTMLElementEventMap

Parameters

element: T

event: K

handler

options?: boolean | AddEventListenerOptions

Returns

Function

Returns

void

Source

packages/blocks/src/_common/utils/event.ts:86

once(element, event, handler, options)

once<T>(element, event, handler, options?): () => void

Type parameters

T extends HTMLElement

Parameters

element: T

event: string

handler

options?: boolean | AddEventListenerOptions

Returns

Function

Returns

void

Source

packages/blocks/src/_common/utils/event.ts:96

once(element, event, handler, options)

once<T, K, M>(element, event, handler, options?): () => void

Type parameters

T extends Document

K extends string | number | symbol

M = DocumentEventMap

Parameters

element: T

event: K

handler

options?: boolean | AddEventListenerOptions

Returns

Function

Returns

void

Source

packages/blocks/src/_common/utils/event.ts:102