From 8e22e43f959bb9cb2a5a40ed9532b6332ff7d7d5 Mon Sep 17 00:00:00 2001 From: cha0s Date: Fri, 19 Apr 2019 00:23:04 -0500 Subject: [PATCH] feat: staged --- packages/graphics/traits/staged.trait.js | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/graphics/traits/staged.trait.js b/packages/graphics/traits/staged.trait.js index a146878..3c5c0ef 100644 --- a/packages/graphics/traits/staged.trait.js +++ b/packages/graphics/traits/staged.trait.js @@ -1,18 +1,15 @@ +import {compose} from '@avocado/core'; import {Trait} from '@avocado/entity'; +import {Property} from '@avocado/mixins'; -export class Staged extends Trait { +const decorate = compose( + Property('stage', { + track: true, + emit: function (...args) { + this.entity.emit(...args); + }, + }) +) - initialize() { - this._stage = undefined; - } - - get stage() { - return this._stage; - } - - set stage(stage) { - this._stage = stage; - } - -} +export class Staged extends decorate(Trait) {}