Reuben Firmin
11/30/2023, 6:16 PMReuben Firmin
11/30/2023, 6:16 PM@file:JsModule("<http://htmx.org|htmx.org>")
@file:JsNonModule
package ah.libs
// see <https://htmx.org/docs/#webpack> (i'm not bothering with the window injection yet)
@JsName("htmx")
external object HTMX {
// see <https://htmx.org/docs/#init_3rd_party_with_events>
fun onLoad(initializer: (content: Any) -> Unit)
}
Reuben Firmin
11/30/2023, 6:16 PMReuben Firmin
11/30/2023, 6:17 PMandylamax
11/30/2023, 9:21 PMandylamax
11/30/2023, 9:24 PMexternal fun require(mod: String): dynamic
then in your main function
window.asDynamic().htmx = require("<http://htmx.org|htmx.org>")
should do the trickReuben Firmin
11/30/2023, 10:29 PMArtem Kobzar
12/01/2023, 9:20 AMandylamax
12/01/2023, 9:33 AM@file:JsModule("<http://htmx.org|htmx.org>")
@file:JsNonModule
package ah.libs
// see <https://htmx.org/docs/#webpack> (i'm not bothering with the window injection yet)
@JsName("htmx")
external object HTMX {
// see <https://htmx.org/docs/#init_3rd_party_with_events>
fun onLoad(initializer: (content: Any) -> Unit)
}
then in main function
window.asDynamic().htmx = HTMX
Artem Kobzar
12/01/2023, 12:14 PMpackage ah.libs
// see <https://htmx.org/docs/#webpack> (i'm not bothering with the window injection yet)
@JsModule("<http://htmx.org|htmx.org>")
@JsNonModule
external object HTMX {
// see <https://htmx.org/docs/#init_3rd_party_with_events>
fun onLoad(initializer: (content: Any) -> Unit)
}
andylamax
12/01/2023, 12:38 PMArtem Kobzar
12/01/2023, 1:32 PMwindow.asDynamic().htmx = HTMX