From 1d3f614d9b9e36d5b265e7ccc101f8d232b8886a Mon Sep 17 00:00:00 2001 From: cha0s Date: Fri, 20 Dec 2019 19:28:22 -0600 Subject: [PATCH] refactor: out of closure --- packages/physics/traits/emitter.trait.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/physics/traits/emitter.trait.js b/packages/physics/traits/emitter.trait.js index 10f1274..c8fde92 100644 --- a/packages/physics/traits/emitter.trait.js +++ b/packages/physics/traits/emitter.trait.js @@ -161,11 +161,11 @@ export class Emitter extends decorate(Trait) { }, emitParticleJson: (json) => { - return K.stream((emitter) => { - let { - count = 1, - rate = 0, - } = json; + let { + count = 1, + rate = 0, + } = json; + const stream = K.stream((emitter) => { if (0 === rate) { for (let i = 0; i < count; ++i) { this.emitParticleJson(json, emitter);