More consitent use of mixins for interaactiong with thing descriptions

This commit is contained in:
Julian Stirling 2025-11-05 17:05:34 +00:00
parent 40b3d993ee
commit 1ba1a3082b
9 changed files with 45 additions and 29 deletions

View file

@ -57,6 +57,13 @@ export const wotStoreModule = {
thingAvailable: (state) => (thingName) => {
return thingName in state.thingDescriptions;
},
thingAffordanceAvailable: (state) => (thing, affordanceType, affordance) => {
let td = state.thingDescriptions[thing];
if (!td) {
return false;
}
return affordance in td[affordanceType];
},
thingFormUrl:
(state) =>
(thing, affordanceType, affordance, op, allowUndefined = true) => {