Liking cljdoc? Tell your friends :D

brave.swords


ajax-litecljs

(ajax-lite uri
           {:keys [method params headers timeout-ms resp-type with-credentials?]
            :as opts
            :or {method :get timeout-ms 10000 resp-type :auto}}
           callback-fn)

(ajax-lite "/my-post-route" {:method :post :params {:username "Rich Hickey" :type "Awesome"} :headers {"Foo" "Bar"} :resp-type :text :timeout-ms 7000 :with-credentials? false ; Enable if using CORS (requires xhr v2+) } (fn async-callback-fn [resp-map] (let [{:keys [success? ?status ?error ?content ?content-type]} resp-map] ;; ?status - e/o #{nil 200 404 ...}, non-nil iff server responded ;; ?error - e/o #{nil <http-error-status-code> <exception> :timeout :abort :http-error :exception :xhr-pool-depleted} (js/alert (str "Ajax response: " resp-map))))) [1] Ref. https://developers.google.com/closure/library/docs/xhrio

(ajax-lite "/my-post-route"
  {:method     :post
   :params     {:username "Rich Hickey" :type "Awesome"}
   :headers    {"Foo" "Bar"}
   :resp-type  :text
   :timeout-ms 7000
   :with-credentials? false ; Enable if using CORS (requires xhr v2+)
  }
  (fn async-callback-fn [resp-map]
    (let [{:keys [success? ?status ?error ?content ?content-type]} resp-map]
      ;; ?status - e/o #{nil 200 404 ...}, non-nil iff server responded
      ;; ?error  - e/o #{nil <http-error-status-code> <exception> :timeout
                         :abort :http-error :exception :xhr-pool-depleted}
      (js/alert (str "Ajax response: " resp-map)))))
[1] Ref. https://developers.google.com/closure/library/docs/xhrio
raw docstring

assoc-keycljs

(assoc-key state ks new-key)

assoc-somecljs

(assoc-some m kvs)
(assoc-some m k v)
(assoc-some m k v & kvs)

Assocs each kv iff its value is not nil.

Assocs each kv iff its value is not nil.
raw docstring

available-heightcljs

(available-height)

available-widthcljs

(available-width)

browsercljs

(browser)

browser-enginecljs

(browser-engine)

browser-langcljs

(browser-lang)

browser-languagescljs

(browser-languages)

browser-mimescljs

(browser-mimes)

browser-namecljs

(browser-name)

browser-pluginscljs

(browser-plugins)

browser-versioncljs

(browser-version)

by-idcljs

(by-id id)

Short-hand for document.getElementById(id)

Short-hand for document.getElementById(id)
raw docstring

charsetcljs

(charset)

client-timecljs

(client-time)

color-depthcljs

(color-depth)

connectioncljs

(connection)

cookiescljs

(cookies)

cookies?cljs

(cookies?)

cpu-corescljs

(cpu-cores)

deaccentcljs

(deaccent input)

debouncecljs

(debounce listener interval)

deep-mergecljs

(deep-merge v & vs)

disposable->functioncljs

(disposable->function disposable listener interval)

dissoc-incljs

(dissoc-in m [k & ks :as keys])

dom-readycljs

(dom-ready event)

domaincljs

(domain)

drop-nthcljs

(drop-nth n coll)

event->valuecljs

(event->value event)

extensioncljs

(extension s)

fancycljs

(fancy sample)

format*cljs

(format* fmt args)

formatocljs

(formato fmt & args)

hostcljs

(host)

host-namecljs

(host-name)

jsx->cljcljs

(jsx->clj x)

local-storagecljs

(local-storage)

map-keyscljs

(map-keys f m)

map a function on keys

map a function on keys
raw docstring

map-valscljs

(map-vals m f)

map a function on values

map a function on values
raw docstring

media-devicescljs

(media-devices)

mobile?cljs

(mobile?)

nil->strcljs

(nil->str x)

obj->cljcljs

(obj->clj obj)

on-clickcljs

(on-click id event)

on-key-presscljs

(on-key-press id event)

online?cljs

(online?)

oscljs

(os)

pc?cljs

(pc?)

performance-memorycljs

(performance-memory)

performance-timingcljs

(performance-timing)

pixel-depthcljs

(pixel-depth)

pr-edncljs

(pr-edn x)
(pr-edn _opts x)

Prints arg to an edn string readable with read-edn.

Prints arg to an edn string readable with `read-edn`.
raw docstring

prev-sitescljs

(prev-sites)

protocolcljs

(protocol)

read-edncljs

(read-edn s)
(read-edn opts s)

redirect!cljs

(redirect! loc)

reduce-kvscljs

(reduce-kvs rf init kvs)

Like reduce-kv but takes a flat sequence of kv pairs.

Like `reduce-kv` but takes a flat sequence of kv pairs.
raw docstring

referrercljs

(referrer)

roundcljs

(round x & {p :precision})

rsomecljs

(rsome pred coll)

safe-readcljs

(safe-read value)

screen-heightcljs

(screen-height)

screen-widthcljs

(screen-width)

(search in filter-string)

set-display!cljs

(set-display! id update)

set-html!cljs

(set-html! id s)

set-val!cljs

(set-val! id update)

str-contains?cljs

(str-contains? s substr)

str-starts-with?cljs

(str-starts-with? s substr)

tablet?cljs

(tablet?)

throttlecljs

(throttle listener interval)

timestampcljs

(timestamp)

timezonecljs

(timezone)

titlecljs

(title)

title!cljs

(title! t)

url-hashcljs

(url-hash)

url-pathcljs

(url-path)

user-agentcljs

(user-agent)

val-by-idcljs

(val-by-id id)

viewportcljs

(viewport)

window-locationcljs

(window-location)

Returns js/window's current location as a map.

Returns `js/window`'s current location as a map.
raw docstring

xhr-pool_cljs

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close