polite-glass-80210
04/16/2023, 3:38 PMnumerous-agent-22346
04/16/2023, 3:57 PM(defn init
" - register service worker listeners"
[]
(js/console.debug "SERVICE WORKER STARTED")
(js/self.addEventListener
"install"
(fn []
(js/console.debug "SERVICE WORKER Install: calling skipWaiting()")
(.skipWaiting js/self)))
(js/self.addEventListener
"activate"
(fn []
(js/console.debug "SERVICE WORKER Activated: claiming clients")
(.claim js/self.clients)
(js/console.debug "SERVICE WORKER claimed clients. Fetch is active."))
;; PROXY SERVER HANDLER
(js/self.addEventListener "fetch" proxy-server/handler)))
the proxy-server/handler
function takes a fetch event and returns a response by calling respondWith
on the eventpolite-glass-80210
04/16/2023, 4:03 PMnumerous-agent-22346
04/16/2023, 4:25 PMpolite-glass-80210
04/16/2023, 4:26 PMnumerous-agent-22346
04/16/2023, 4:38 PMnpx serve public
, it should workpolite-glass-80210
04/16/2023, 5:32 PMminiature-lizard-24702
04/16/2023, 6:39 PMpolite-glass-80210
04/16/2023, 6:42 PMmysterious-toddler-20573
04/16/2023, 9:00 PMmysterious-toddler-20573
04/16/2023, 9:04 PMwhite-rocket-20067
04/17/2023, 2:44 PMmysterious-toddler-20573
04/17/2023, 2:47 PMwhite-rocket-20067
04/17/2023, 2:50 PMwhite-rocket-20067
04/17/2023, 2:50 PMmysterious-toddler-20573
04/17/2023, 2:55 PMnot
)white-rocket-20067
04/17/2023, 2:58 PMmysterious-toddler-20573
04/17/2023, 3:05 PMshy-knife-59740
04/17/2023, 4:32 PMx-on="click"
or x-trigger="click"
?shy-knife-59740
04/17/2023, 4:42 PMhtml
<button class="cookie-btn"
hx-get="/cookie"
x-on="click">
Okay
</button>
refined-waiter-90422
04/17/2023, 5:19 PMrefined-waiter-90422
04/17/2023, 5:20 PMmicroscopic-cartoon-64495
04/18/2023, 8:42 AMimport 'htmx.org';
window.htmx = require('htmx.org');
import 'htmx.org/dist/ext/loading-states';
refined-waiter-90422
04/18/2023, 10:20 AM<script>
microscopic-cartoon-64495
04/18/2023, 11:09 AMstocky-dentist-80693
04/18/2023, 12:16 PMimport 'htmx.org/dist/htmx.js';
// -> `window.htmx` will now be defined
shy-knife-59740
04/18/2023, 12:47 PMhtml
<button class="cookie-btn cookie-confirm"
hx-get="/createsession"
x-on="click htmx:afterRequest: alert('Done making a request!')">
Okay
</button>
tried this but doesent work, without the click
it wont work too, no idea whyripe-action-67367
04/18/2023, 12:48 PMx-on
? Seems like a typoshy-knife-59740
04/18/2023, 12:50 PM