0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

Add kvstore repo ns.

This commit is contained in:
Andrey Antukh 2016-11-05 19:51:27 +01:00
parent 6379315e4b
commit 1e5777f4b6
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -0,0 +1,25 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.main.repo.kvstore
"A main interface for access to remote resources."
(:require [beicon.core :as rx]
[uxbox.config :refer (url)]
[uxbox.main.repo.impl :refer (request send!)]
[uxbox.util.transit :as t]))
(defmethod request :fetch/kvstore
[_ id]
(let [url (str url "/kvstore/" id)
params {:url url :method :get}]
(send! params)))
(defmethod request :update/kvstore
[_ data]
(println ":update/kvstore" data)
(let [url (str url "/kvstore")
params {:url url :method :put :body data}]
(send! params)))