diff options
author | kumavis <aaron@kumavis.me> | 2018-05-29 05:29:31 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2018-05-29 05:29:31 +0800 |
commit | 5be154ea2035810462ff0e7051e537870bfc1afb (patch) | |
tree | 438d5c4cf20001645adff24151d9f0222bbf5782 /app/scripts/lib | |
parent | 9f8d5f05470d68a7a9a5474a5b1f4587398e94a3 (diff) | |
download | tangerine-wallet-browser-5be154ea2035810462ff0e7051e537870bfc1afb.tar.gz tangerine-wallet-browser-5be154ea2035810462ff0e7051e537870bfc1afb.tar.zst tangerine-wallet-browser-5be154ea2035810462ff0e7051e537870bfc1afb.zip |
controllers - transactions - merge @frankiebee's work with mine
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/util.js | 14 |
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, |