refactor: decorate property types
This commit is contained in:
parent
8c657994b4
commit
a7b34bfcd1
|
@ -1,3 +1,5 @@
|
||||||
|
import {mapObject} from '@avocado/core'
|
||||||
|
|
||||||
export function behaviorTypes() {
|
export function behaviorTypes() {
|
||||||
return {
|
return {
|
||||||
entity: (entity) => {
|
entity: (entity) => {
|
||||||
|
@ -20,7 +22,11 @@ export function behaviorTypes() {
|
||||||
};
|
};
|
||||||
return Traits
|
return Traits
|
||||||
.reduce((r, T) => ({
|
.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);
|
}), core);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user