-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rochmar Nicolas (DevExpress)
committed
Jul 22, 2024
1 parent
05ac05e
commit 4e37a6b
Showing
2 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
21 changes: 11 additions & 10 deletions
21
packages/devextreme/js/__internal/events/utils/m_event_nodes_disposing.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import eventsEngine from '../core/events_engine'; | ||
import { removeEvent } from '../remove'; | ||
import eventsEngine from '@js/events/core/events_engine'; | ||
import { removeEvent } from '@js/events/remove'; | ||
|
||
function nodesByEvent(event) { | ||
return event && [ | ||
event.target, | ||
event.delegateTarget, | ||
event.relatedTarget, | ||
event.currentTarget | ||
].filter(node => !!node); | ||
return event && [ | ||
event.target, | ||
event.delegateTarget, | ||
event.relatedTarget, | ||
event.currentTarget, | ||
].filter((node) => !!node); | ||
} | ||
|
||
export const subscribeNodesDisposing = (event, callback) => { | ||
eventsEngine.one(nodesByEvent(event), removeEvent, callback); | ||
// @ts-expect-error | ||
eventsEngine.one(nodesByEvent(event), removeEvent, callback); | ||
}; | ||
|
||
export const unsubscribeNodesDisposing = (event, callback) => { | ||
eventsEngine.off(nodesByEvent(event), removeEvent, callback); | ||
eventsEngine.off(nodesByEvent(event), removeEvent, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from '../../__internal/events/utils/m_event_nodes_disposing'; |