Created
July 17, 2020 10:55
-
-
Save benvp/ad0d4a933f4bef58fe783eba14606e85 to your computer and use it in GitHub Desktop.
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
import 'alpinejs'; | |
// ... | |
let liveSocket = new LiveSocket('/live', Socket, { | |
dom: { | |
// make LiveView work nicely with alpinejs | |
onBeforeElUpdated(from, to) { | |
if (from.__x) { | |
window.Alpine.clone(from.__x, to); | |
} | |
}, | |
}, | |
params: { | |
_csrf_token: csrfToken, | |
}, | |
}); | |
// ... some more code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment