From 013b518e4570c5e28e0c343f51355959b91f0bd5 Mon Sep 17 00:00:00 2001 From: Alexander Morse Date: Thu, 26 Sep 2019 17:15:01 -0400 Subject: [PATCH 1/3] Fix incorrect usage of EffectFactory#get --- src/EffectFactory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EffectFactory.js b/src/EffectFactory.js index ac10b4fb..960bce35 100644 --- a/src/EffectFactory.js +++ b/src/EffectFactory.js @@ -49,7 +49,7 @@ class EffectFactory { * @return {object} */ get(id) { - return this.get(id); + return this.effects.get(id); } /** From 0455460bb30b0e80466b43a643551d3259148776 Mon Sep 17 00:00:00 2001 From: Alexander Morse Date: Thu, 26 Sep 2019 17:36:50 -0400 Subject: [PATCH 2/3] Add docstring to EffectFactory#has --- src/EffectFactory.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/EffectFactory.js b/src/EffectFactory.js index 960bce35..896b7b13 100644 --- a/src/EffectFactory.js +++ b/src/EffectFactory.js @@ -39,6 +39,9 @@ class EffectFactory { this.effects.set(id, { definition, eventManager }); } + /** + * @see Map#has + */ has(id) { return this.effects.has(id); } From 090fe0a41b21df49474f9b3af9690b479135dab8 Mon Sep 17 00:00:00 2001 From: Alexander Morse Date: Thu, 26 Sep 2019 18:03:18 -0400 Subject: [PATCH 3/3] Update EffectFactory#get to return effect definition --- src/EffectFactory.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EffectFactory.js b/src/EffectFactory.js index 896b7b13..34855a3d 100644 --- a/src/EffectFactory.js +++ b/src/EffectFactory.js @@ -52,7 +52,8 @@ class EffectFactory { * @return {object} */ get(id) { - return this.effects.get(id); + const entry = this.effects.get(id); + if (entry) return entry.definition; } /**