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
;; run npx playwright install to install a browser | |
(require '[babashka.deps :as deps]) | |
(deps/add-deps | |
'{:deps {tatut/devtools {:git/url "https://github.com/tatut/clj-chrome-devtools" | |
:git/sha "cc96255433ca406aaba8bcee17d0d0b3b16dc423"} | |
org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha" | |
:git/sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}}}) |
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
#!/usr/bin/env bb | |
;; Inspired from https://book.babashka.org/#_running_tests | |
(require '[clojure.test :as t] | |
'[clojure.string :as string] | |
'[babashka.classpath :as cp] | |
'[babashka.fs :as fs]) | |
(cp/add-classpath "src:test") |
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
(ns async | |
(:import [goog.async Throttle Debouncer])) | |
(defn disposable->function [disposable listener interval] | |
(let [disposable-instance (disposable. listener interval)] | |
(fn [& args] | |
(.apply (.-fire disposable-instance) disposable-instance (to-array args))))) | |
(defn throttle [listener interval] | |
(disposable->function Throttle listener interval)) |