Removed node-wot but kept centralised TD store
I had intended to store a ConsumedThing for each Thing, in a module in the store. Until that is possible (will require some more attention to dependency management) I will just store the TDs instead. This commit includes a lot of the code I wrote for node-wot use, but without any dependence on node-wot.
This commit is contained in:
parent
45d2884159
commit
595101248e
6 changed files with 265 additions and 16 deletions
|
|
@ -34,6 +34,16 @@ Vue.config.productionTip = false;
|
|||
|
||||
Vue.mixin({
|
||||
methods: {
|
||||
async getThingDescription(thing) {
|
||||
// Get the thing description for the given thing
|
||||
let origin = this.$store.state.origin;
|
||||
let uri = `${origin}/${thing}/`;
|
||||
// We cache TDs in the store, and fetch only if needed.
|
||||
if (!(uri in store.state.wot.thingDescriptions)) {
|
||||
await store.dispatch("wot/fetchThingDescription", uri);
|
||||
}
|
||||
return store.state.wot.thingDescriptions[uri];
|
||||
},
|
||||
modalConfirm: function(modalText) {
|
||||
var context = this;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue