diff options
author | 2022-07-30 09:16:45 +0200 | |
---|---|---|
committer | 2022-07-30 14:16:45 +0700 | |
commit | 50cb93948c8ce0fe23a8f4dd8a62184562257220 (patch) | |
tree | 8a9c8180b9059c35f7468b9c69c49df4103f462c /source/features/extend-diff-expander.tsx | |
parent | 808c68f3745cfe15d1995546d5519b75dc9386e1 (diff) | |
download | refined-github-50cb93948c8ce0fe23a8f4dd8a62184562257220.tar.gz refined-github-50cb93948c8ce0fe23a8f4dd8a62184562257220.tar.zst refined-github-50cb93948c8ce0fe23a8f4dd8a62184562257220.zip |
Meta: Deinit all feature delegates using `AbortSignal` (#5726)
Co-authored-by: Federico Brigante <me@fregante.com>
Diffstat (limited to 'source/features/extend-diff-expander.tsx')
-rw-r--r-- | source/features/extend-diff-expander.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/features/extend-diff-expander.tsx b/source/features/extend-diff-expander.tsx index 8ea375ce..b42f3e4a 100644 --- a/source/features/extend-diff-expander.tsx +++ b/source/features/extend-diff-expander.tsx @@ -1,19 +1,19 @@ import './extend-diff-expander.css'; import select from 'select-dom'; -import delegate from 'delegate-it'; +import delegate, {DelegateEvent} from 'delegate-it'; import * as pageDetect from 'github-url-detection'; import features from '.'; -function expandDiff(event: delegate.Event): void { +function expandDiff(event: DelegateEvent): void { // Skip if the user clicked directly on the icon if (!(event.target as Element).closest('.js-expand')) { select('.js-expand', event.delegateTarget)!.click(); } } -function init(): Deinit { - return delegate(document, '.diff-view .js-expandable-line', 'click', expandDiff); +function init(signal: AbortSignal): void { + delegate(document, '.diff-view .js-expandable-line', 'click', expandDiff, {signal}); } void features.add(import.meta.url, { |