aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/util.js')
-rw-r--r--app/scripts/lib/util.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/scripts/lib/util.js b/app/scripts/lib/util.js
index 431d1e59c..7ceb9da3c 100644
--- a/app/scripts/lib/util.js
+++ b/app/scripts/lib/util.js
@@ -99,7 +99,21 @@ function BnMultiplyByFraction (targetBN, numerator, denominator) {
return targetBN.mul(numBN).div(denomBN)
}
+function applyListeners (listeners, emitter) {
+ Object.keys(listeners).forEach((key) => {
+ emitter.on(key, listeners[key])
+ })
+}
+
+function removeListeners (listeners, emitter) {
+ Object.keys(listeners).forEach((key) => {
+ emitter.removeListener(key, listeners[key])
+ })
+}
+
module.exports = {
+ removeListeners,
+ applyListeners,
getStack,
getEnvironmentType,
sufficientBalance,