diff --git a/src/uxbox/main/repo/kvstore.cljs b/src/uxbox/main/repo/kvstore.cljs new file mode 100644 index 000000000..ba6406aa1 --- /dev/null +++ b/src/uxbox/main/repo/kvstore.cljs @@ -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 + +(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)))