Fetch API wrapper for clojurescript!
Add dependency to your project.clj file.
Add dependency to your dependencies vector.
...
:dependencies
[...
[org.clojars.scknkkrer/suluk "0.0.7"]
...]
...
Require suluk
from your project.
(ns perfect.cljs.app
(:require [suluk.core :as suluk]
...
;; Use fetch! function from suluk.core namespace for the functionality.
;; This function takes a keyword as first paramter that represents method of your request.
;; Each method type has individual function signature.
;; GET -> [url function-map]
;; GET request example:
(suluk/fetch! :get
"https://jsonplaceholder.typicode.com/todos/1"
[suluk.response/res->json js/console.info])
;; => #object [Promise [object Promise]]
;; Returns promise for the future usage.
;; The third argument of the function is applied to response of the request,
;; With left-to-right direction respectively.
[x] Change the way the work of this library! | 08.09.2018
[ ] Complete the README.md!
[ ] Allow keywords as a function in function-map
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close