htmx.org
Version:
high power tools for html
12 lines (11 loc) • 359 B
JavaScript
htmx.defineExtension('morphdom-swap', {
isInlineSwap: function(swapStyle) {
return swapStyle === 'morphdom';
},
handleSwap: function (swapStyle, target, fragment) {
if (swapStyle === 'morphdom') {
morphdom(target, fragment.outerHTML);
return [target]; // let htmx handle the new content
}
}
});