summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheia2023-02-02 06:47:20 -0500
committertheia2023-02-02 06:47:20 -0500
commit3520fb4a41a6293ed0a530483c9487bfd737e801 (patch)
treeb8c0a7227365b569d3d3e6dd88ffde9e680eda21
parent7a74781828afc169cd2b076403e77bc4b49c12f5 (diff)
Added other methods
-rw-r--r--plugins/vue/plugin.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/vue/plugin.js b/plugins/vue/plugin.js
index 2c61f40..b0fd134 100644
--- a/plugins/vue/plugin.js
+++ b/plugins/vue/plugin.js
@@ -16,11 +16,19 @@ export default {
app.config.globalProperties.$graffitiID.value = graffiti.myID
})
- // Add logging in and out
- app.config.globalProperties.$graffitiToggleLogIn =
- graffiti.toggleLogIn.bind(graffiti)
+ // Add static functions
+ const methodMapping = {
+ 'ToggleLogIn': 'toggleLogIn',
+ 'Update': 'update',
+ 'Tags': 'myTags',
+ 'ObjectByKey': 'objectByKey'
+ }
+ for (const key in methodMapping) {
+ app.config.globalProperties['$graffiti'+key] =
+ graffiti[methodMapping[key]].bind(graffiti)
+ }
- // A composable for subscribing and
+ // A component for subscribing and
// unsubscribing to tags that returns
// a reactive array of the results
app.component('GraffitiObjects', {