From 5f7af124513d7c225ceb52b31113b867fa8c85ef Mon Sep 17 00:00:00 2001 From: Gustavo Guzman Date: Tue, 18 Feb 2025 17:38:49 +0100 Subject: [PATCH] feat: add extensionsToIgnore to withExtensions --- src/htmx.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/htmx.js b/src/htmx.js index 424da472c..29f2eb00d 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -3009,15 +3009,17 @@ var htmx = (function() { /** * `withExtensions` locates all active extensions for a provided element, then - * executes the provided function using each of the active extensions. It should + * executes the provided function using each of the active extensions. You can filter + * the element's extensions by giving it a list of extensions to ignore. It should * be called internally at every extendable execution point in htmx. * * @param {Element} elt * @param {(extension:HtmxExtension) => void} toDo + * @param {string[]=} extensionsToIgnore * @returns void */ - function withExtensions(elt, toDo) { - forEach(getExtensions(elt), function(extension) { + function withExtensions(elt, toDo, extensionsToIgnore) { + forEach(getExtensions(elt, [], extensionsToIgnore), function(extension) { try { toDo(extension) } catch (e) {