mirror of
https://github.com/penpot/penpot.git
synced 2025-07-27 07:17:24 +02:00
30 lines
646 B
Clojure
30 lines
646 B
Clojure
;; 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) KALEIDOS INC
|
|
|
|
(ns app.plugins.utils
|
|
"RPC for plugins runtime."
|
|
(:require
|
|
[app.util.object :as obj]))
|
|
|
|
(defn get-data
|
|
([self attr]
|
|
(-> (obj/get self "_data")
|
|
(get attr)))
|
|
|
|
([self attr transform-fn]
|
|
(-> (get-data self attr)
|
|
(transform-fn))))
|
|
|
|
(defn get-data-fn
|
|
([attr]
|
|
(fn [self]
|
|
(get-data self attr)))
|
|
|
|
([attr transform-fn]
|
|
(fn [self]
|
|
(get-data self attr transform-fn))))
|
|
|
|
|