refactor: decorate property types

This commit is contained in:
cha0s 2020-06-25 07:44:13 -05:00
parent 8c657994b4
commit a7b34bfcd1

View File

@ -1,3 +1,5 @@
import {mapObject} from '@avocado/core'
export function behaviorTypes() {
return {
entity: (entity) => {
@ -20,7 +22,11 @@ export function behaviorTypes() {
};
return Traits
.reduce((r, T) => ({
...r, children: {...r.children, ...T.behaviorTypes(), ...T.describeState()},
...r, children: {
...r.children,
...T.behaviorTypes(),
...mapObject(T.describeState(), (spec) => ({...spec, type: `property|${spec.type}`})),
},
}), core);
},
};