Last active
April 29, 2016 23:27
-
-
Save whacked/e42a0fa70288f36343d58c83f4d389b1 to your computer and use it in GitHub Desktop.
dynamic css reloader in sibilant
This file contains hidden or 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
;; reload css | |
(scoped | |
(var all-link (document.getElementsByTagName "link") | |
i 0) | |
(while (< i all-link.length) | |
(var link (get all-link i)) | |
(when (< -1 (|> (link.getAttribute "type") | |
(.indexOf "css"))) | |
(console.log "reload " link) | |
(assign link.href (+ link.href "?t=" (|> (new Date) | |
.getTime)))) | |
(incr i))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment